**Wireless Networks**

Xi Jin Changqing Xia Chi Xu Dong Li

# Mixed-Criticality Industrial Wireless Networks

# **Wireless Networks**

#### **Series Editor**

Xuemin Sherman Shen, University of Waterloo, Waterloo, ON, Canada

The purpose of Springer's Wireless Networks book series is to establish the state of the art and set the course for future research and development in wireless communication networks. The scope of this series includes not only all aspects of wireless networks (including cellular networks, WiFi, sensor networks, and vehicular networks), but related areas such as cloud computing and big data. The series serves as a central source of references for wireless networks research and development. It aims to publish thorough and cohesive overviews on specific topics in wireless networks, as well as works that are larger in scope than survey articles and that contain more detailed background information. The series also provides coverage of advanced and timely topics worthy of monographs, contributed volumes, textbooks and handbooks.

\*\* Indexing: Wireless Networks is indexed in EBSCO databases and DPLB \*\*

Xi Jin • Changqing Xia • Chi Xu • Dong Li

# Mixed-Criticality Industrial Wireless Networks

Xi Jin Shenyang Institute of Automation, Chinese Academy of Sciences Shenyang, Liaoning, China

Chi Xu Shenyang Institute of Automation, Chinese Academy of Sciences Shenyang, Liaoning, China

Changqing Xia Shenyang Institute of Automation, Chinese Academy of Sciences Shenyang, Liaoning, China

Dong Li Shenyang Institute of Automation, Chinese Academy of Sciences Shenyang, Liaoning, China

This work was supported by Chinese Academy of Sciences

ISSN 2366-1186 ISSN 2366-1445 (electronic) Wireless Networks ISBN 978-981-19-8921-6 ISBN 978-981-19-8922-3 (eBook) https://doi.org/10.1007/978-981-19-8922-3

© The Editor(s) (if applicable) and The Author(s) 2023. This book is an open access publication.

**Open Access** This book is licensed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made.

The images or other third party material in this book are included in the book's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the book's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.

The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication does not imply, even in the absence of a specific statement, that such names are exempt from the relevant protective laws and regulations and therefore free for general use.

The publisher, the authors, and the editors are safe to assume that the advice and information in this book are believed to be true and accurate at the date of publication. Neither the publisher nor the authors or the editors give a warranty, expressed or implied, with respect to the material contained herein or for any errors or omissions that may have been made. The publisher remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

This Springer imprint is published by the registered company Springer Nature Singapore Pte Ltd. The registered company address is: 152 Beach Road, #21-01/04 Gateway East, Singapore 189721, Singapore

# **Preface**

Important tasks must be completed on time and with guaranteed quality; that is, the consensus reached by system designers and users. However, for too long, important tasks have often been given unnecessary urgency, and people intuitively believe that important tasks should be executed first so that their performance can be guaranteed. Actually, in most cases, their performance can be guaranteed even if they are executed later, and the "early" resources can be utilized for other, more urgent tasks. Therefore, confusing importance with urgency hinders the proper use of system resources. In 2007, mixed criticality was proposed to indicate that a system may contain tasks of various importance levels. Since then, system designers and users have distinguished between importance and urgency.

In the industrial field, due to the harsh environment they operate in, industrial wireless networks' quality of service (QoS) has always been a bottleneck restricting their applications. Therefore, this book introduces criticality to label important data, which is then allocated more transmission resources, ensuring that important data's QoS requirements can be met to the extent possible.

To help readers understand how to apply mixed criticality to industrial wireless networks, the content is divided into four parts. First, we introduce how to integrate the model of mixed-criticality data into industrial wireless networks (Chap. 1). Second, we explain how to analyze the schedulability of mixed-criticality data under existing scheduling algorithms (Chaps. 2 and 3). Third, we present a range of novel scheduling algorithms for mixed-criticality data (Chaps. 4, 5, and 6). Finally, we conclude this book and discuss future research directions (Chap. 7).

We hope that this book will inspire further research on mixed-criticality industrial wireless networks.

Shenyang, China Xi Jin

September 2022 Changqing Xia Chi Xu Dong Li

# **Acknowledgments**

We would like to thank Dr. Meng Zheng, Dr. Chunhe Song, Dr. Peng Zeng, Dr. Haibin Yu, Dr. Keyan Cao, Dr. Guoqi Xie, and Dr. Qingxu Deng for their helpful discussions and contributions to the research presented in this book, without which this book could not be completed.

This book was also supported in part by the National Natural Science Foundation of China under Grant 62133014, Grant 61972389, Grant 62022088, Grant 61903356, Grant 62173322, Grant 92067205, and Grant U1908212; in part by the Youth Innovation Promotion Association of the Chinese Academy of Sciences under Grant Y2021062, Grant 2019202, and Grant 2020207; in part by the National Key Research and Development Program of China under Grant 2020YFB1710900; in part by the International Partnership Program of Chinese Academy of Sciences under Grant 173321KYSB20200002; in part by the Central Guidance on Local Science and Technology Development Fund of Liaoning Province under Grant 2022JH6/100100013; and in part by the Liaoning Provincial Natural Science Foundation of China under Grant 2020-MS-034.

# **Contents**




# **Chapter 1 Introduction**

**Abstract** In this chapter, we first provide an overview of industrial wireless networks from the perspectives of industrial communication requirements and classical industrial wireless networks. Then, mixed criticality is introduced, and the role of mixed criticality in industrial wireless networks is also discussed. Last, we present the organization of this book.

#### **1.1 Industrial Wireless Networks**

The real economy with manufacturing as the core is a concrete manifestation of national economic strength and international competitiveness [1]. In the past 20 years, the manufacturing industry is undergoing the fourth industrial revolution, which is introducing intelligence into the industrial production process, commonly known as intelligent manufacturing (or smart manufacturing). Intelligent manufacturing has been widely recognized as an advanced technology to improve production efficiency and reduce production costs. To seize the commanding heights of the manufacturing industry, major industrial countries are striving to improve the intelligence of the manufacturing industry, and have issued relevant development initiatives, such as Germany's "Industry 4.0", China's "Made in China 2025", the United States' "Advanced Manufacturing Partnership", the United Kingdom's "Future of Manufacturing", and France's "Industrie du Futur" (as shown in Fig. 1.1). What these initiatives have in common is that they must be network-based.

Modern manufacturing has involved a large number of elements, such as machines, people, raw materials, etc. In order to make these elements form a whole system, networks must be used in industrial systems [2], called industrial networks. Industrial networks connect all elements together to implement the collection of industrial data and the sending of control commands. These uplink and downlink processes constitute a closed-loop control that enables intelligent manufacturing. Therefore, industrial networks are one of the important infrastructures of intelligent manufacturing.

**Fig. 1.1** Initiatives of some industrial countries

#### *1.1.1 Network-Based Intelligent Manufacturing Systems*

According to a research report by MarketsandMarkets, the global intelligent manufacturing market size in 2021 is USD 88.7 billion, and it is expected to reach USD 228.2 billion by 2027. Some large international companies have turned their attention to intelligent manufacturing and have successfully built related industrial systems. In all of these, the network plays a critical role. Typical systems are as follows:


ment of the whole process of industrial production. The company's ultimate goal is to create a sustainable future industry.

• *Mitsubishi Electric* has built a lithium battery intelligent manufacturing line to support high-precision, high-efficiency and high-flexibility production. The line adopts a time-sensitive network to double the communication performance and increase the production efficiency by 50%.

#### *1.1.2 Industrial Communication Requirements*

Since industrial elements must be connected by industrial networks, the quality of service (QoS) of the networks seriously affects industrial production processes. Once the industrial network cannot deliver data packets to their destinations while meeting the communication requirements, it may lead to serious problems such as the decline of control performance, the stagnation of industrial production, and even safety production accidents. Therefore, before designing an industrial network, we must understand the requirements of industrial communications.

In different application scenarios, networks must meet different requirements. The most common requirement is transmission speed, which is present in all networks, not limited to industrial networks. Civilian networks, e.g., WiFi and cellular networks, are constantly evolving to meet users' transmission speed requirements. For this kind of requirement, industrial networks can learn from the advanced techniques of civilian networks to solve the problems in industrial scenarios. In addition to this, industrial networks should meet the following special communication requirements:



it is possible that the patient will be seriously injured. Diagnostic robots get information from bodies without harming the patients, so their reliability can be slightly reduced. In control-related scenarios, the reliability of most applications should reach 99.9999% [5]. However, since the performance of open-loop control is relatively low, their reliability requirements for industrial networks are slightly lower. In monitoring-related scenarios, since monitoring data packets are allowed to transmit for a long time, they can compensate for the low reliability with multiple retransmissions. Therefore, monitoring-related applications have the minimum reliability requirements.

• *Massive Connection Requirement*: Massive connections [6] mean that a large number of network devices are connected to a network at the same time. The number of connected devices around the world shows explosive growth (as shown in Fig. 1.2). In 2003, there were 0.5 billion connected devices around the world, and the number of connected devices per person was 0.08 [7]. Then, in 2020, while the world's population is growing slowly, the number of connected devices is estimated to have increased to 50 billion, and each person has an average of 6.58 connected devices. According to this trend, by 2025, the number of connected devices per person will be 9.27 [8]. The same trend exists in industrial systems. In the early days of industrial networks, only dozens of industrial devices needed to be connected together. Then, with the growth of industrial applications and the improvement of intelligence, the number of industrial devices is increasing exponentially. At present, existing industrial

**Fig. 1.2** Massive connection

systems already connect tens of thousands of devices. This trend will continue, and the number of connected devices will be higher in the future.

#### *1.1.3 Classical Industrial Wireless Networks*

For the special requirements of industrial communications, industrial wired networks (such as time-sensitive networks, PROFINET, Modbus TCP, etc.) are capable of meeting the real-time and reliability requirements, but cannot connect millions of devices with cables. Therefore, wired networks can only be used in small-scale industrial applications, or only as backbone networks.

Compared with wired networks, wireless networks simplify the network deployment and reduce maintenance costs. Hence, industrial applications should apply wireless networks to connecting devices. However, due to the inherent openness of the wireless environment [9], how to improve the real-time performance and reliability of wireless networks has always been the focus of the industry and scholars. In classical industrial wireless networks, the related techniques and algorithms are as follows:

#### **1.1.3.1 WirelessHART**

WirelessHART [10] is a global IEC-approved standard (IEC 62591) that specifies a robust and reliable wireless sensor-actuator network, and has been widely-used in industrial process monitoring and control. WirelessHART is built on top of the IEEE 802.15.4 standard, and defines star and mesh topologies (as shown in Fig. 1.3). It provides enabling techniques for real-time scheduling such as time synchronization, time division multiple access and multiple channels, etc. Although the WirelessHART standard excludes real-time scheduling algorithms, scholars have proposed many related studies. In 2010, the basic idea of multiprocessor scheduling was introduced into WirelessHART networks [11]. Thus, in

**Fig. 1.3** Topologies supported by WirelessHART. (**a**) Star topology. (**b**) Mesh topology

**Fig. 1.4** Real-time scheduling model of WirelessHART networks

the scheduling model of WirelessHART networks (as shown in Fig. 1.4), multiple channels correspond to multiple processors, and the time slot used for a transmission corresponds to the running time of a task on processors. However, links and routing paths are excluded in multi-processor systems. Therefore, the main difference between them is that network scheduling must strictly follow the sequence of links in a path, while multi-processor scheduling does not need to consider this. Since the network scheduling model is based on the multi-processor scheduling model, many multi-processor scheduling algorithms, such as fixed priority assignment, dynamic priority scheduling, preemptive scheduling, etc., have been improved to use in WirelessHART networks [12–15].

In addition, to improve the network reliability, WirelessHART adopts the graph routing policy [16–18] (as shown in Chap. 3.2). In a routing graph, there are multiple paths from each node to the destination node, so that data packets can be copied and sent multiple times to improve the reliability. At the same time, WirelessHART supports frequency hopping mechanisms to improve the anti-interference ability of transmissions.

**Fig. 1.5** The topology supported by WIA-PA

**Fig. 1.6** The communication rule of WIA-PA

#### **1.1.3.2 WIA-PA**

WIA-PA (IEC 62601) [19] is also based on the IEEE 802.15.4 standard. The main difference from WirelessHART is that WirelessHART defines two topologies (star and mesh), while WIA-PA is a hybrid of star and mesh topologies (as shown in Fig. 1.5). In the star network, field devices upload their data to the routing device. Then, in the mesh network, routing devices transmit data to the gateway. Thus, the communication rule of WIA-PA is specified according to the hybrid topology (as shown in Fig. 1.6). The mesh network cannot transmit until all transmissions in the star network are finished. The hybrid topology can improve the network scalability [20, 21] and enables WIA-PA to support most of the WirelessHART strategies.

**Fig. 1.7** The topology supported by WIA-FA

**Fig. 1.8** Segments of WIA-FA

#### **1.1.3.3 WIA-FA**

WIA-FA (IEC 62948) [22] and WIA-PA belong to a family of standards. The main difference is that WIA-FA is based on the IEEE 802.11 standard. Hence, WIA-FA only defines a redundant star topology (as shown in Fig. 1.7) and does not need any routing mechanism. To improve the real-time performance and reliability, WIA-FA adopts multiple access points and redundant devices. Based on these features, the communication of WIA-FA is segmented (as shown in Fig. 1.8). Access points are divided into several groups, and the transmission time is correspondingly divided into the same number of segments. Each group is assigned one segment. The access points of a group are allowed to occupy only the assigned segment. In a segment, first, access points broadcast beacons to field devices, and then according to the configuration in beacons, field devices start to work. Since the topology of WIA-FA is a simplification of WIA-PA and WirelessHART, some of the algorithms of WIA-PA and WirelessHART can be used in WIA-FA. In addition, based on multiple access points, a real-time scheduling algorithm for highly reliable retransmissions has been proposed to meet industrial communication requirements [23].

**Fig. 1.9** The topology supported by ISA100.11a

#### **1.1.3.4 ISA100.11a**

ISA100.11a (IEC 62734) [24] is also based on the IEEE 802.15.4 standard. Its topology is similar to that of WirelessHART (as shown in Fig. 1.9), and most of the techniques used in WirelessHART to improve the real-time performance and reliability also exist in ISA100.11a, such as time division multiple access, multiple channels and graph routing. Therefore, the scheduling model and relevant strategies of WirelessHART can also be applied to ISA100.11a. In addition, the design goal of ISA100.11 is different from those of the other networks. ISA100.11a was designed for ease of use. Flexible configuration interfaces and IPv6 are included in ISA100.11a. These techniques enable ISA100.11a to easily connect to other networks.

#### **1.2 Mixed Criticality**

Mixed criticality [25] is a new system characteristic, which is different from the real-time performance and reliability of systems. However, the methods proposed based on mixed criticality can guarantee the real-time performance and reliability of the systems with limited resources. In addition, since the mixed-criticality methods are aimed at limited resources, they can also be a solution to support massive connections.

**Fig. 1.10** An example of mixed-criticality systems

#### *1.2.1 Mixed Criticality Overview*

Mixed-criticality systems define extensions to real-time embedded systems with limited resources. The traditional real-time performance measures the urgency of tasks, not their importance. Then, mixed-criticality systems are proposed to highlight the importance of tasks. In such systems, important tasks are called high-criticality tasks, and unimportant tasks are called low-criticality tasks. Mixedcriticality systems can execute in multiple criticality modes, and criticality level is also one of the attributes of tasks. To make it clearer, in the following, a system model with two criticality levels (high and low) is introduced. For multiple criticality levels, the system model can be easily extended.

As shown in Fig. 1.10, when the system with two criticality levels starts, it must be in the low-criticality mode, and all tasks are allowed to execute. During system execution, some internal or external dynamic disturbances may cause highcriticality tasks to fail to meet performance requirements. Then, the system switches to the high-criticality mode. In the high-criticality system mode, high-criticality tasks are allowed to use more resources to guarantee their real-time performance and reliability, while low-criticality tasks have to be discarded if there are not sufficient resources. In this way, the performance of high-criticality tasks can be guaranteed as much as possible, and then the system performance can be maximized under limited resources.

For different systems, mixed-criticality models are different [26]. In this book, we only focus on industrial wireless networks.

#### *1.2.2 Mixed Criticality in Industrial Wireless Networks*

In industrial wireless networks, criticality is an inherent property of data packets [27, 28]. For example, Fig. 1.11 shows an industrial wireless network for cement manufacturing. The rotary kiln is the most important equipment. If the rotary kiln

*rotary kiln*

**Fig. 1.11** An industrial wireless network in a cement factory

has some exceptions and its temperature data are lost or miss deadline, workers cannot take measures in time. This will lead to production inefficiency. By contrast, even if the temperature data of pre-heaters cannot be delivered to the destination within deadlines, the temperature of materials can be sensed in the pre-calciner. Hence, the temperature data of the rotary kiln are more critical than those of preheaters. In the wireless network, when the important equipment has an exception, its sensing data have to be quickly and reliably delivered to the control room. This process needs more network resources. However, the resources of wireless networks are very limited. When the resources cannot guarantee the requirements of all data packets, the packets that belong to lower-criticality levels have to be discarded.

Based on the above basic rules of mixed-criticality wireless networks, some novel algorithms are needed to analyze and schedule the mixed-criticality packets so that as many packets as possible can be satisfied under performance constraints. The key feature of mixed-criticality systems is that the resources assigned to high-criticality tasks can be dynamically increased during system execution. Therefore, the main difference among the various mixed-criticality systems is what the resources are and how to use the resources. For example, in mixed-criticality multi-processor systems, the resource is the execution time of a task on processors, while, in mixed-criticality wireless networks, there are various types of resources, including time slots and channels at the data link layer, and routing path at the network layer. In this book, we will introduce some algorithms to solve the analyzing and scheduling problem of mixed-criticality data packets from the perspective of network resources.

#### **1.3 Book Organization**

In this book, we will see how mixed criticality helps to improve the performance of industrial wireless networks. The rest of this book is organized as follows: In Chaps. 2 and 3, we analyze the schedulability of mixed-criticality data packets under two classical scheduling algorithms. Chapter 4 presents a new algorithm to schedule mixed-criticality data packets in time-division multiple-access networks. Chapter 5 extends the model of Chap. 4, and uses the devices with multiple radio interfaces to improve the schedulability of mixed-criticality data packets. Chapter 6 addresses the mixed-criticality scheduling problem of industrial 5G new radio. Finally, we conclude this book in Chap. 7.

#### **References**


**Open Access** This chapter is licensed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made.

The images or other third party material in this chapter are included in the chapter's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the chapter's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.

# **Chapter 2 Schedulability Analysis of Mixed-Criticality Data Under Fixed-Priority Scheduling**

**Abstract** WirelessHART, as a robust and reliable wireless protocol, has been widely-used in industrial systems. Its real-time performance has been extensively studied, but limited to the single-criticality case. Many advanced applications have mixed-criticality communications, where different data flows come with different criticality levels. Hence, in this chapter, we study the real-time mixed-criticality communication based on WirelessHART networks, and present an end-to-end delay analysis method under fixed priority scheduling.

#### **2.1 Background**

WirelessHART is based on a centralized network management and multi-channel Time Division Multiple Access (TDMA). These special features have attracted researchers' attentions, and they have done some studies to improve the real-time performance of WirelessHART networks, e.g. [1–4]. However, all these studies focus on the single-criticality case. Advanced real applications come with mixedcriticality data communications, such as the case of the cement factory in Sect. 1.2.2.

The key difference between mixed- and single-criticality systems is that the criticality of data in mixed-criticality systems must be considered together with real-time performance [5]. This leads to the problem that directly using traditional priority-based scheduling algorithms of single-criticality systems to mixedcriticality systems is infeasible due to independence between criticality and traditional priorities [6–12]. Therefore, the traditional real-time theory needs a revision to support mixed-criticality networks.

There are a few related studies on mixed-criticality networks. The work in [13–15] designs Network-on-Chips for mixed-criticality multiprocessor systems. The work in [16] proposes mixed-criticality protocols for the Controller Area Network (CAN), and then a response-time analysis method and an optimal priority assignment scheme are provided. The work in [17] designs a virtual CAN controller to provide differentiated services for different criticality levels. The work in [18– 20] focuses on the wired network—TTEthernet. They propose some scheduling algorithms to guarantee the performance of messages under real-time constraints. The work in [21] is about wireless networks. It introduces a mixed-criticality scheduling method to JPEG2000 video systems based on the IEEE 802.11 standard. However, WirelessHART networks are based on the IEEE 802.15.4 standard and are quite different from the wireless video system. Therefore, existing system models and solutions cannot be used in the WirelessHART model.

Since the end-to-end delay analysis is the foundation of the real-time theory, in this chapter, we present an end-to-end delay analysis method for fixed priority scheduling in mixed-criticality real-time WirelessHART networks. The analysis can be used to test whether the data flows can meet their special requirements when designing a WirelessHART network.

In the following, first, we introduce the concept of mixed criticality into real-time wireless sensor-actuator networks and propose a formulated system model; second, we propose an end-to-end delay analysis method, which is a fast feasible method to test the reliability of mixed-criticality systems; third, evaluation results show that the proposed method is very effective and only incurs little pessimism comparing with simulation results and a real testbed.

#### **2.2 System Model**

#### *2.2.1 Mixed-Criticality Wireless Network Model*

We consider a WirelessHART network characterized by *G* =*< V,E,m >*:


The data flow set is denoted by <sup>F</sup> = {*F*1*, F*2*,...*}. Each flow *Fi* is characterized by *Fi* =*< χi, ci, ti(x), pi, φi >*. *pi* denotes the distinct fixed priority. *φi* (*φi* ⊆ *E*) is an ordered sequence of links and denotes the routing path of the flow *Fi*. The centralized manager of the WirelessHART network collects sensing data and distributes actuator data, so the gateway is the source or destination for each flow. In the TDMA policy, each time slot allows a one-hop data transmission and its acknowledgement to be transmitted. We use *ci* to denote the number of time slots required to deliver a packet from the source to the destination, i.e., *ci* is equal to the number of hops of the flow *Fi*.

*χi* denotes the criticality level of the flow *Fi*. For ease of presentation, we only focus on a dual-criticality system, in which there are only two criticality levels *L* (low) and *H* (high). However, it can be easily extended to systems with an arbitrary number of criticality levels. Correspondingly, the network also has dual-criticality modes {*H,L*}. If the criticality level of the flow *Fi* is not less than the current network mode *x*, it can be delivered; otherwise, the flow is discarded. The network starts in the low-criticality mode (*x* = *L*), in which all flows are served. When an error or exception occurs in a node, the node will trigger the changing of the network mode from low criticality to high criticality (*x* = *H*). Then only the flows with high-criticality level can be delivered, and the low-criticality flows are discarded. Note that the mode change will introduce additional time to the delay of the highcriticality flow and the message of mode change should be broadcast to the entire network as soon as possible. There are some methods used to solve this problem. For example, one channel of each node can be reserved to serve the message. Therefore, we only model the duration of the mode change as *C*, which is used to calculate the delay of the packet delivered during the mode change.

When errors and exceptions occur, workers will handle problems and change the mode from high criticality to low criticality. We do not consider this process due to the unpredictability of workers' behavior, i.e., we do not study the mode change from high criticality to low criticality. The assumption is also widely adopted in existing works (such as [22–24] etc.).

In mixed-criticality uniprocessor/multiprocessor systems, the execution time of a task is a function of the system mode. In wireless networks, the number of time slots required to deliver a packet is equal to the number of hops and fixed. However, the period *ti* is dependent on the network criticality mode. Since the important flow is more frequently delivered when the network mode is changed to high criticality, hence, *ti(H ) < ti(L)*.

According to the period *ti(x)*, the flow *Fi* periodically releases a packet, which is assigned the parameters specified in *Fi*. Our system adopts the implicit-deadline, i.e., the packet's relative deadline is equal to the flow's period corresponding with the network mode of generating the packet. For example, if the packet is released in the network mode *L*, then its relative deadline is *ti(L)*. Therefore, in a stable network, at most one packet of each flow is active at any time. However, when the network mode is changed from *L* to *H*, there may exist two active packets belonging to one flow because of the change of the flow's period. In this case, the packet released in the network mode *H* has higher priority than another.

A packet is released at time slot *s*1, and arrives at its destination at time slot *s*2, then its end-to-end delay is (*s*<sup>2</sup> − *s*<sup>1</sup> + 1). The end-to-end delay of a flow is the maximum delay among all its packets. If a scheduling algorithm can schedule all flows such that all packets' end-to-end delays are less than or equal to their deadlines, the flow set is called *schedulable* under the scheduling algorithm.

Note that not all of the above assumptions are supported by the original WirelessHART protocol. However, they can be implemented in the application layer [1–3]. In Sect. 2.4, our real testbed is introduced.

#### *2.2.2 Fixed Priority Scheduling*

We focus on the end-to-end delay analysis for fixed priority scheduling, which is the most commonly used real-time scheduling in real systems. In fixed priority scheduling, transmissions are scheduled within a hyper-period *T* , which is equal to the least common multiple of periods of all flows, since after that all schedules are cyclically repeated. The period supported by the WirelessHART protocol is 2*<sup>i</sup>* , where *i* is an integer greater than or equal to 0. Therefore, the hyper-period *T* is equal to the maximum period among all flows. At each time slot of *T* , if there exist unused channels, the transmission with the highest priority is scheduled. However, if the released transmission shares nodes with the transmissions that have been scheduled at this time slot, it cannot be scheduled since one node cannot serve more than one transmission at one time slot (as shown in Fig. 2.1). Therefore, there are two factors influencing the transmission scheduling: *channel contention* (there are no unused channels assigned to the transmission) and *transmission conflicts* (a transmission cannot be scheduled, if it shares a node with a transmission that has been scheduled in this time slot). In other words, the two factors introduce extra delays. In the following, we analyze delays introduced by two factors separately.

**Fig. 2.1** Fixed priority scheduling


**Table 2.1** Key notations

**Problem Statement** Given the mixed-criticality WirelessHART network *G*, the flow set F and the fixed priority scheduling algorithm, our objective is to analyze the end-to-end delay for each flow, such that the schedulability of the flow set can be determined.

Table 2.1 summarizes the key notations used in this chapter.

#### **2.3 End-to-End Delay Analysis**

Our analysis is based on the *EDA* (End-to-end Delay Analysis) method [1], which is the state-of-the-art end-to-end delay analysis for fixed priority scheduling in singlecriticality real-time WirelessHART networks. To make this chapter self-contained, we first introduce EDA. Then we present our end-to-end delay analysis for mixedcriticality WirelessHART Networks.

#### *2.3.1 Analysis for Single-Criticality Networks*

The EDA analysis contains two steps. The first step calculates the delay due to channel contention, which is called *pseudo upper bound* of the worst case end-toend delay and denoted by *Rch <sup>k</sup>* . Then the second step incorporates the delay due to transmission conflicts into the result of the first step.

#### **2.3.1.1 Pseudo Delay**

The flow *Fk* experiences the worst case delay when the level-*k* busy period occurs. The *level-k busy period* is the maximum continuous time interval during which all channels are occupied by flows of priority higher than the priority of *Fk* , until *Fk* finishes its active packet transmitting. The notation *hp(Fk )* is used to denote the set of flows whose priorities are higher than *Fk*. If the flow *Fi* (*Fi* ∈ *hp(Fk )*) has a packet with release time earlier than the level-*k* busy period and deadline in the level-*k* busy period, it is said to have *carry-in* workload in the busy period. Then two types of workload are presented as follows:

• *WNC <sup>k</sup> (Fi, α)* denotes the workload upper bound in the level-*k* busy period of *α* slots, if *Fi* has no carry-in workload:

$$W\_k^{NC}(F\_l, \alpha) = \left\lfloor \frac{\alpha}{t\_l} \right\rfloor \cdot c\_l + \min(\alpha \bmod t\_l, c\_l).$$

where *ti* denotes the period of *Fi* in single-criticality networks.

• *WCI <sup>k</sup> (Fi, α)* denotes the workload upper bound in the level-*k* busy period of *α* slots, if *Fi* has a carry-in workload:

$$W\_k^{CI}(F\_l, \alpha) = \left\lfloor \frac{\max(\alpha - c\_l, 0)}{t\_l} \right\rfloor \cdot c\_l + c\_l + \mu\_l$$

where *μi* = min*(*max*(*max*(α* − *ci,* 0*)* − *(ti* − *Ri),* 0*), ci* − 1*)* and *Ri* denotes the worst case end-to-end delay of *Fi* in single-criticality networks.

Similarly, there are two types of interference between *Fi* and *Fk* during *α* slots:

$$I\_k^{NC}(F\_l, \alpha) = \min(W\_k^{NC}(F\_l, \alpha), \alpha - c\_k + 1) \tag{2.1}$$

$$I\_k^{CI}(F\_l, \alpha) = \min(W\_k^{CI}(F\_l, \alpha), \alpha - c\_k + 1) \tag{2.2}$$

At most *m* − 1 higher priority flows have carry-in workload in the network with *m* channels. Therefore, *Fk* 's total delay due to channel contention is

$$\Omega\_k(\alpha) = \sum\_{F\_l \in hp(F\_k)} I\_k^{NC}(F\_l, \alpha) + U\_k(\alpha)$$

where *Uk(α)* is the sum of the min*(*|*hp(Fk )*|*, m*−1*)* largest values of the differences *ICI <sup>k</sup> (Fi, α)* <sup>−</sup> *<sup>I</sup> NC <sup>k</sup> (Fi, α)* among all *Fi* ∈ *hp(Fk )*.

#### 2.3 End-to-End Delay Analysis 21

The WirelessHART network contains *m* channels, so Eq. (2.3) shows the delay due to channel contention. And the pseudo upper bound *Rch <sup>k</sup>* is the minimal value of *α* that solves Eq. (2.3). *α* can be found using the iterative fixed-point algorithm [25], which is widely used in the delay analysis of real time systems. The iterative calculation of *α* starts at *α* = *ck*. During the iterations, if *α* is larger than the deadline of the flow *Fk* , the algorithm terminates and the flow set is unschedulable; if the value of *α* is fixed and less than the deadline, the fixed-point is *Rch k* .

$$\alpha = \left\lfloor \frac{\Omega\_k(\alpha)}{m} \right\rfloor + c\_k \tag{2.3}$$

#### **2.3.1.2 Worst Case Delay**

This step incorporates the delay due to transmission conflicts into *Rch <sup>k</sup>* to calculate the actual end-to-end delay *Rk*. First, we introduce some definitions.


$$\Delta(k,i) = \mathcal{Q}(k,i) - \sum\_{j=1}^{\sigma} \left(\delta\_j'(k,i) - \mathfrak{Z}\right)^2$$

where *σ* is the number of maximal common paths between *Fk* and *Fi*.

Thus the upper bound of the actual delay *Rk* is the minimal solution of Eq. (2.4) by running the iterative fixed point algorithm starting at *<sup>β</sup>* <sup>=</sup> *<sup>R</sup>ch k* .

$$\beta = R\_k^{ch} + \sum\_{F\_l \in hp(F\_k)} \left\lceil \frac{\beta}{t\_l} \right\rceil \cdot \Delta(k, i) \tag{2.4}$$

#### *2.3.2 Analysis for Mixed-Criticality Networks*

Mixed-criticality networks dynamically change the network mode, which results in three types of packets transmitted in the network:


*Rk (L)* is unaffected by the mode change and is equal to the delay *Rk* calculated in single-criticality networks. Therefore, we only analyze *Rk(H )* and *Rk(L*2*H )*.

#### **2.3.2.1 Analyzing** *Rk(H )*

In the network mode *H*, packets belonging to the high-criticality flow are delivered, no matter when they are released. Therefore, *Rk(H )* is interfered by the following two flow sets

$$\begin{aligned} hpL(F\_k) &= \{ F\_l | F\_l \in \mathbb{F}', \, p\_l < p\_k, \, \chi\_l = H \}, \\\\ hpH(F\_k) &= \{ F\_l | F\_l \in \mathbb{F}, \, p\_l > p\_k, \, \chi\_l = H \}. \end{aligned}$$

From these, we can derive that the delay due to channel contention is

$$\Omega\_k(\alpha) = \sum\_{F\_l \in hpH(F\_k) \cap hpL(F\_k)} I\_k^{NC}(F\_l, \alpha) + U\_k(\alpha)$$

where *Uk(α)* is also for the interferences of *hpH (Fk)* and *hpL(Fk )*. Note that the interferences of flows in *hpH (Fk)* are the same with Eqs. (2.1) and (2.2), since the flows release packets periodically. However, the flow *Fi* (*Fi* ∈ *hpL(Fk )*) is delivered only once. In the worst case, its workload in the level-*k* busy period is min{*α, ci*}. Therefore,

$$\forall F\_l \in hpL(F\_k) : I\_k^{CI}(F\_l, \alpha) = I\_k^{NC}(F\_l, \alpha) = \min(\min(\alpha, c\_l), \alpha - c\_k + 1)$$

Then the pseudo upper bound *Rch <sup>k</sup> (H )* can be derived based on Eq. (2.3).

For the delay due to transmission conflicts, similarly, besides the periodic flows in *hpH (Fk)*, the flows in *hpL(Fk )* delivered only once will introduce *(k, i)* to *Rk(H )*. Therefore,

$$\beta = R\_k^{ch}(H) + \sum\_{F\_l \in hpH(F\_k)} \left\lceil \frac{\beta}{t\_l(H)} \right\rceil \cdot \Delta(k, i) + \sum\_{F\_l \in hpL(F\_k)} \Delta(k, i) \tag{2.5}$$

According to Eq. (2.5), the iterative algorithm can be used to find the fixed *β*, i.e., *Rk(H )*.

#### **2.3.2.2 Analyzing** *Rk(L***2***H )*

The flow *Fk* (*Fk* <sup>∈</sup> <sup>F</sup> ) is divided into two flows. The first flow *FkL* is delivered in the *L* mode, and the second flow *FkH* is in the *H* mode. We use *R<sup>r</sup> <sup>k</sup> (L)* and *<sup>R</sup><sup>r</sup> <sup>k</sup> (H )* to denote the delays of *FkL* and *FkH* , respectively, where *r* means that the packet has passed through *r* hops before the mode change, and *r* ∈ [0*, ck*−1]. Correspondingly, *ckL* = *r* and *ckH* = *ck* − *r*. And priorities of *FkL* and *FkH* are assigned as *pk*.

The calculation of *R<sup>r</sup> <sup>k</sup> (L)* is the same as that of *Rk(L)*, since they are all in the stable network. However, *R<sup>r</sup> <sup>k</sup> (H )* is different from *Rk(H )*. According to our system model, packets released by *Fk* in the network mode *H* have higher priority than the packets of *FkH* . Therefore, the delay contributed by these higher priority packets must be added to *R<sup>r</sup> <sup>k</sup> (H )*, i.e., *FkH* is interfered by *hpL(Fk )*, *hpH (Fk)* and {*Fk*} in the network mode *H*. From these, we can derive

$$\Omega\_{kH}(\alpha) = \sum\_{F\_l \in hpH(F\_k) \cap hpL(F\_k) \cap \{F\_k\}} I\_{kH}^{NC}(F\_l, \alpha) + U\_{kH}(\alpha)$$

where *UkH* is for *hpL(Fk )*, *hpH (Fk)* and {*Fk*}. For the flow *FkH* , *Fk* releases higher priority packets periodically. The interference introduced by *Fk* is the same as that by *hpH (Fk)*. Therefore, Eqs. (2.1) and (2.2) also can be used to calculate it.

For the delay due to transmission conflicts, the packets released by {*Fk*} must be considered. Then the actual end-to-end delay is shown as follows:

$$\beta = R\_{kH}^{ch}(H) + \sum\_{F\_l \in hpH(F\_k) \cap \{F\_k\}} \left[ \frac{\beta}{t\_l(H)} \right] \cdot \Delta(kH, i) + \sum\_{F\_l \in hpL(F\_k)} \Delta(kH, i)$$

And *R<sup>r</sup> <sup>k</sup> (H )* is also solved by the iterative algorithm.

The range of *r* is from 0 to *ck* − 1. If *r* = 0, it means that the packet has been released but not been delivered before the network mode is changed to *H*. Thus, *ckL* = 0. This will cause the failure of the iterative algorithm. Therefore, if ∃*Fi* and *pi > pk*, *α* starts with 1; otherwise, there is no interference for *Fk* and *R<sup>r</sup> <sup>k</sup> (L)* = 0. If *r* = *ck*, it means that the packet has been delivered to its destination in the *L* network mode. Hence, the delay of the packet is *Rk(L)*.

The delay of *Fk* is the sum of *R<sup>r</sup> <sup>k</sup> (L)* and *<sup>R</sup><sup>r</sup> <sup>k</sup> (H )*. However, different values of *r* lead to different *R<sup>r</sup> <sup>k</sup> (L)* and *<sup>R</sup><sup>r</sup> <sup>k</sup> (H )*. Therefore, the upper bound of *Fk*'s delay is

$$R\_k(L2H) = \max\_{r \in [0, c\_k - 1]} \{ R\_k^r(L) + R\_k^r(H) \} + C$$

where *C* is the additional time introduced by the mode change (shown in Sect. 2.2).

To sum up, if the flow *Fk* satisfies *Rk(L)* ≤ *tk(L)*, *Rk(H )* ≤ *tk(H )* and *Rk(L*2*H )* ≤ *tk(L)*, then it is schedulable. In a flow set, if all the flows are schedulable, the flow set is schedulable. The calculation of our analysis is in pseudo polynomial time because our analysis is based on the iterative fixed-point algorithm.

#### **2.4 Performance Evaluations**

In this section, we will compare our analysis method with simulations and a real testbed.

#### *2.4.1 Simulations*

In order to illustrate the applicability of our method, for each parameter configuration, 100 test cases are generated randomly. For each test case, the gateway is placed at the center and other nodes are placed randomly in the playground area *A*. According to the suggestion in [26], the number of nodes *n* and the playground area *A* should satisfy

$$\frac{n}{A} = \frac{2\pi}{d^2\sqrt{27}}$$

where the transmitting range *d* is set as 40 m. Then, each node connects to the nearest node, which must be in its transmitting range and has been connected to the gateway. If some nodes cannot connect to the gateway, their locations are generated randomly again.

The flow set <sup>F</sup> contains <sup>0</sup>*.*<sup>8</sup> · *<sup>n</sup>* flows. Other parameters are set as follows. We use the utilization *u* (*u* = <sup>∀</sup>*Fi*∈<sup>F</sup> *ci*/*ti*) to control the workload of the entire network, and *UUniFast algorithm* [27] is used to generate each flow's utilization *ui* (*ui* =*ci* /*ti*). The result generated by UUniFast algorithm follows a uniform distribution and is neither pessimistic, nor optimistic for the analysis. For the flow *Fi*, its criticality level is assigned randomly. If *χi* = *H*, then *ti(L)* = 2 log*t i* 2 and *ti(H )* = 2 log*t i* 2 ; otherwise, *ti(L)* = 2 log*t i* 2 and *ti(H )* = +∞. The mode change duration *C* is set as the maximum number of hops between any two nodes of the network. If one channel and one transmitter of each node are reserved to serve the mode change, the change command can be broadcast to all the nodes in the duration *C*. The fixed priority assignment follows the two classical algorithms [28]: (1) Deadline Monotonic (*DM*), in which the flow with the shorter deadline is assigned the higher priority; (2) Proportional Deadline monotonic (*P D*), in which the flow with the shorter subdeadline is assigned the higher priority. *Subdeadline* is defined for its deadline divided by the total number of its transmissions.

The mode change can occur at any time slot. Hence, the simulation should list all cases. However, for the complex state space, the execution time of simulations is unacceptable. Therefore, if the execution time exceeds 30 minutes, the simulation is suspended and the maximum delay is chosen as the worst case end-to-end delay. We use *pessimism ratio* (the proportion of our analyzed delay to the maximum delay observed in simulations) and *acceptance ratio* (the percentage of flow sets that are schedulable) as the performance metrics.

Figure 2.2 plots the pessimism ratios with different numbers of nodes. We set that *m* = 12 and *u* = 1. In order to make test cases simulated in an acceptable time, the number of nodes is only up to 110. From the figures, we can see that the 75th percentile of the pessimism ratios is less than 2*.*1 and 2*.*2 for DM and PD, respectively. In [1], the result of the state-of-the-art analysis EDA for single-criticality networks is 1*.*5 and 1*.*6, respectively. Compared with them, our analysis only introduces a small degree of pessimism, even though the mode change increases the complexity of the end-to-end delay analysis. Therefore, our analysis is highly effective.

In order to evaluate the performance of our analysis method for the larger scale networks in an acceptable time, we set *m* = 6 and *u* = 1. Figure 2.3 shows the boxplots of the pessimism ratios under varying network sizes. From the evaluation results, we know that our analysis method is stable under different network sizes. Comparing with Fig. 2.2, Fig. 2.3 is more pessimistic. The less number of channels introduces more contentions, and the delay analysis is to consider the worst case scenario. Thus, all of additional contentions are considered in the delay analysis, but not all of them appear in simulations. Therefore, the analysis with fewer channels is more pessimistic.

We compare the acceptance ratios of our analysis and simulations, and the utilization *u* is increased to 3*.*2. Figure 2.4 shows the comparison, in which *AMC* is our Analysis for Mixed-Criticality networks and *SIM* is the result of simulations. We observe that our results are close to those of simulations. Therefore, our analysis method can be used to verify whether flows can meet their deadlines or not before implementing the real system.

Comparing Fig. 2.4a and b, we observe that the acceptance ratio of the policy PD is less than that of the policy DM. It is because that, compared with the policy DM, the policy PD introduces more interferences to the flows with short paths, which leads to a longer delay. Similarly, all the interferences are considered in the delay analysis, but not all of them appear in simulations. Therefore, in Figs. 2.2 and 2.3, the result of PD is more pessimistic than that of DM.

#### *2.4.2 Real Testbed*

We implement a real testbed that contains three types of physical devices: the gateway device, routing devices and field devices. The gateway device manages the network and adopts a low power SoC (System of Chip) AT91RM9200 and a CC2420 transceiver chip. The routing device is implemented on an MSP430 and a CC2420. The field device is equipped with a temperature and humidity sensor SHT15 besides an MSP430 and a CC2420. Our testbed supports the IEEE 802.15.4 protocol, which is the physical and MAC (Medium Access Control) layers of WirelessHART networks, and an improved WirelessHART network according to our requirements. The improved WirelessHART implements the specific requirements

in the application layer, and it is compatible with the original WirelessHART. Channel 23 is used to broadcast mode change messages and configuration messages. Six schedulable channels are 15–20. Additionally, six devices are configured as sniffers to monitor packets transmitted on the six channels. Then the sniffed packet with a timestamp is sent to a PC via an 8-port RS-232 PCI Express serial board.

Figure 2.5 shows our testbed. The network is deployed in a building. For each parameter configuration, 100 test cases are implemented. The generation of configurations is the same as in simulations. The configuration message is sent to devices via the gateway. Figure 2.6 shows pessimism ratios in a certain scope under different parameters. The point of the pessimism ratio 1*.*4 reports the number of test cases, whose pessimism ratios are between 1*.*4 and 1*.*6. When the utilization is set as 1 and the number of channels is 12, compared with PD and DM, our average

**Fig. 2.5** Our testbed

pessimism ratio of 100 test cases is about 2*.*5 and 2*.*4, respectively. The result is more pessimistic than the simulations. It is because that real cases only cover a little state space. The delay observed in the real testbed is not the worst case delay, while our analysis focuses on the worst case. Therefore, for the end-to-end delay, our analysis method is more reliable than real tests.

#### **2.5 Summary**

Multiple criticality levels co-exist in real-life wireless networks. However, previous works only focus on the single-criticality network. We present an end-to-end delay analysis method for fixed priority scheduling in mixed-criticality WirelessHART networks, which can be used to determine whether all flows can be delivered to their destinations within their deadlines. In evaluations, we compare our analysis results with simulations and a testbed. The results show that the pessimism of our analysis is acceptable and reliable.

#### **References**


**Open Access** This chapter is licensed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made.

The images or other third party material in this chapter are included in the chapter's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the chapter's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.

# **Chapter 3 Schedulability Analysis of Mixed-Criticality Data Under EDF Scheduling**

**Abstract** In this chapter, to improve the schedulability of high-criticality flows when the network is running, we present a supply/demand bound function analysis method based on earliest deadline first (EDF) scheduling. In addition, our method considers both source routing and graph routing. At the beginning, when the network is in low-criticality mode, source routing is applied. When errors or exceptions occur, the network switches to high-criticality mode, and network routing turns to graph routing to guarantee that critical flows can be scheduled. By estimating the demand bound for the mixed-criticality data model, we can determine the schedulability of industrial wireless networks.

#### **3.1 Background**

Graph routing [1] as an effective way to improve network reliability has been widely used in recent years. A network under graph routing allocates two dedicated time slots for each transmission; if the first transmission fails, a retransmission will be sent. Furthermore, the controller assigns a third shared slot on a separate path for another retransmission. Since graph routing is a reliable method to handle transmission failures, a few works have begun to focus on graph routing. The work in [2] presents the first worst-case end-to-end delay analysis for periodic real-time flows under reliable graph routing. The work in [3] studies the network lifetime maximization problem under graph routing. However, graph routing introduces great challenges for real-time analysis. Many conflicts are generated on a large number of transmission tasks. Obviously, the task which is more critical but has a low priority may miss its deadline in this situation. However, many systems need to guarantee high-criticality task's schedulability even though in the worst case. That is really very important in many scenarios such as industrial production line, vehicle driving system, etc. To improve the schedulability of high-criticality flows when the network is running, we introduce resource analysis into mixedcriticality industrial wireless networks. Mixed-criticality network can improve the schedulability of high-criticality flows by dynamically switching the network criticality, and resource analysis is a major way to analyze the schedulability in real-time systems. Combining mixed-criticality network and resource analysis, we can estimate the schedulability of networks with different critical levels.

In this chapter, we propose a novel industrial network model with EDF scheduling. Our objective is to improve the network reliability, especially for high-criticality flows to arrive at their destinations on time even though in the worst case. We analyze the network schedulability by the method of resource analysis. The network is reliable when the network resource supply is no less than the network upper demand in any length of time slot. The main challenges in our work are (1) how to evaluate network demand when a network switches from low-criticality mode to high-criticality mode and (2) how to tighten the network demand bound function to ensure that the analysis result is not too pessimistic. The network we focus on, in the beginning, works in low-criticality mode, and the flows transmit under the EDF policy [4] and source routing. The packets are transmitted from the source to the destination on the primary paths; when an error occurs or the demand changes, the network switches to high-criticality mode to enhance the schedulability of high-criticality flows. The network substitutes reliable graph routing for source routing. Furthermore, we present a supply/demand bound analysis method to analyze the schedulability of periodic flows in industrial wireless sensor networks. By comparing the relationship between network supply bound and demand, we can predict whether the network can be scheduled. The current study makes the following key contributions:


#### **3.2 System Model**

We consider an industrial wireless network consisting of field devices, one gateway, and one centralized network manager. Our network is proposed in three aspects. We first propose a network model that is abstracted from mainstream industrial network standards. Then, we introduce a mixed-criticality network. Finally, we apply EDF scheduling in the industrial network.

#### *3.2.1 Network Model*

Without loss of generality, our model has the same salient features as WirelessHART and WIA-PA, which make it particularly suitable for process industries:

*Time Division Multiple Access (TDMA)* In industrial wireless sensor networks, time is synchronized and slotted. Because the length of a time slot allows exactly one transmission, TDMA protocols can provide predictable communication latency and real-time communication.

*Route and Spectrum Diversity* To mitigate physical obstacles, broken links, and interference, the messages are routed through multiple paths. Spectrum diversity gives the network access to all 16 channels defined in the IEEE 802.15.4 physical layer and allows per-time slot channel hopping. The combination of spectrum and route diversity allows a packet to be transmitted multiple times, over different channels and different paths, thereby handling the challenges of network dynamics in harsh and variable environments at the cost of redundant transmissions and scheduling complexity [5].

*Handling Internal Interference* Industrial networks allow only one transmission in each channel in a time slot across the entire network, thereby avoiding the spatial reuse of channels. Thus, the total number of concurrent transmissions in the entire network at any slot is no greater than the number of available channels.

With the above features, the network can be modeled as a graph *G* = *(V , E, m)*, in which the node set *V* represents the network devices (all sensor nodes in our model are fixed), *E* is the set of edges between these devices, and *m* is the number of channels. Network routing is shown in Fig. 3.1; our model supports both source routing and graph routing. Source outing is well known in academic research; we will not explore it in this article. Graph routing is a unique feature of industrial

**Fig. 3.1** Network routing. (**a**) Source routing. (**b**) Graph routing

wireless sensor networks. In graph routing, a routing graph is a directed list of paths that connect two devices. As shown in Fig. 3.1b, graph routing has a primary path and multiple backup paths. This provides redundancy in the route and improves the reliability. As stated in the standard of WirelessHART, for each intermediate node on the primary path, a backup path is generated to handle link or node failure on the primary path. The network manager allocates *α* dedicated slots, a transmission and *(α* − 1*)* retransmission on the primary path. A *(α* + 1*)*th shared slot is allocated on the backup path, usually *α* = 2. In a dedicated slot, one channel only allows one transmission. However, for the case of a shared slot, the transmissions having the same receiver can be scheduled in the same slot. The senders that attempt to transmit in a shared slot contend for the channel using a carrier sense multiple access with collision avoidance (CSMA/CA) scheme [2]. Hence, multiple transmissions can be scheduled in the same channel to contend in a shared slot. For instance, the network manager allocates two dedicated slots for the packet transmits from node *S* to node *V*<sup>1</sup> in Fig. 3.1b. After the transmissions on the primary path, a third slot is allocated for the packet transmits from node *S* to *V*<sup>5</sup> as a backup path. When two backup paths intersect at node *V*3, they can avoid collision by CSMA/CA.

It is important to note that the receiver responds with an ACK packet before retransmission and backup; the sender retransmits or sends a backup packet when it does not receive an ACK. Because ACK is a part of the transmission, we do not need to especially analyze the demand of ACK.

#### *3.2.2 Mixed-Criticality Network*

A periodic end-to-end communication between a source and a destination is called a *flow*. Network switch instruction is a part of the control flow. Because we analyze network total demand, we need not distinguish whether a flow is a data flow or a control flow. The total number of flows in the network is *n*, denoted by *F* = {*F*1*, F*2*,...,Fn*}. *Fi* is characterized by *< ti, di,ξ,ci, φi >*, 1 ≤ *i* ≤ *n*, where *ti* is the period; *di* is the deadline; *ξ* is the criticality level (we focus on dual-criticality network {*LO, H I* }); *ξ* = 2, means the network allocates two slots, one transmission and one retransmission. Our model can be easily extended to networks with an arbitrary number of criticality levels (by increasing the number of retransmissions on the primary path); *ci* is the number of hops required to deliver a packet from source to destination. When the network mode switches to high criticality, we denote the total transmission hops of both the primary path and shared paths as *Ci*; and *φi* is the routing path of the flow. Thus, we can describe each flow *Fi* as follows. *Fi* periodically generates a packet at its period *ti*, and then sends it to the destination before its deadline *di* via the routing path *φi* with *ci* hops.

In the beginning, messages are transmitted under source routing in low criticality. When an error occurs or the demand changes, the control flow will send a switch instruction, and the network will switch to high-criticality mode. To enhance network reliability, the messages are transmitted under graph routing when the network is running on high-criticality mode. This is an irreversible process; highcriticality mode will never switch back to low-criticality mode (the analytical method of irreversible processes is similar to criticality mode switches from low to high). After the switch, we are not required to meet any deadlines for low-criticality flows, but high-criticality flows may instead execute for up to their high-criticality level characters.

#### *3.2.3 EDF Scheduling in Industrial Networks*

In this subsection, we provide an overview of the earliest deadline first scheduling under industrial wireless sensor networks to analyze network schedulability. EDF scheduling is a commonly adopted policy in practice for real-time CPU scheduling, cyber-physical systems, and industrial networks [6]. In an EDF scheduling policy, each job priority is assigned by its absolute deadline, and the transmission is scheduled based on this priority. Each node in our network is equipped with a half-duplex omnidirectional radio transceiver that can alternate its status between transmitting and receiving. There are two kinds of delay in industrial wireless sensor networks, which can be summarized as follows:


In EDF scheduling, the priority is inversely proportional to its absolute deadline. We explain the operating principle of EDF scheduling in Fig. 3.2. There are two

**Fig. 3.2** An example for EDF scheduling. (**a**) Routing. (**b**) EDF scheduling

channels(CH1 and CH2) and flows in this network. At the beginning, the priority of *F*<sup>2</sup> is higher than *F*<sup>1</sup> since *d*<sup>2</sup> = 4 *< d*<sup>1</sup> = 5. Then the controller allocates CH1 for *F*<sup>2</sup> first. The flow with lower priority must be delayed when transmission conflict occurs such as *F*<sup>1</sup> will be delayed by *F*<sup>2</sup> at the 3rd time slot. At the 5th time slot, the second packet is generated by *F*<sup>2</sup> with an absolute deadline 8, which is larger than 5. Hence, the priority inversion, and CH1 are allocated to *F*1.

Channel contention occurs when high-priority jobs occupy all channels in a time slot; a transmission conflict is generated when several transmissions involve a common node at the same dedicated slot, and a low-priority job is delayed by high-priority ones. However, for the case of shared slots, transmissions with the same receiver can be scheduled in the same slot. When channel contention occurs between backup paths, the senders on the backup path use a CSMA/CA scheme to contend for the channel, and a network delay will not result in this condition. For a network under graph routing, two paths *φi* and *φj* involving a common node may conflict in four conditions:


Except for condition 3, the other three conditions may generate transmission conflicts. Consequently, the total delay caused by these conditions depends on how their primary and backup paths intersect in the network.

In a real-time system, one task is schedulable when it could be executed completely before its deadline. Hence, the flow could be scheduled when all the packets generated by the flow could arrive destination before their relative deadlines. Then we define the network schedulability as whether or not all flows in a network are schedulable.

#### **3.3 Problem Formulation**

Given a mixed-criticality industrial network *G = (V, E, m)*, the flow set *F* and the EDF scheduling algorithm, our objective is to analyze the relationship between the maximum execution demand of the flows and network resource in any time interval such that the schedulability of the flow set can be determined. A successful method to analyzing the schedulability of real-time workloads is to use demand bound functions [7, 8]. We introduce this concept into industrial wireless sensor networks and propose two definitions as follows:

**Definition 3.1 (Supply Bound Function)** A supply bound function sbf(l) is the minimal transmission capacity provided by the network within a time interval of length l.

**Definition 3.2 (Demand-Bound Function)** A demand bound function dbf(*Fi*, l) gives an upper bound on the maximum possible execution demand of flow *Fi* in any time interval of length l, where demand is calculated as the total amount of required execution time of flows with their whole scheduling windows within the time interval.

There are methods for computing the supply bound function *sbf (l)* in singleprocessor systems [9, 10]—for example, a unit-speed, dedicated uniprocessor has *sbf (l)* = *l*. We say that a supply bound function *sbf* is of no more than unit speed if

$$sff(0) = 0 \land \forall l, k \ge 0: sbf(l+k) - sbf(l) \le k. \tag{3.1}$$

Because each channel can be mapped as one processor, the supply bound function *sbf* of the industrial network can be bounded as

$$sfbf(0) = 0 \land \forall l, k \ge 0: sbf(l+k) - sbf(l) \le Ch \times k,\tag{3.2}$$

where *Ch* is the number of channels in the network. Furthermore, as a natural assumption of all proposed virtual resource platforms in the literature, we assume that the supply bound function is piecewise linear in all intervals [*k, k* + *l*]. In TDM (time division multiple), the network supply bound function can be expressed as

$$sbf(l) = \max(l \mod \Theta - \Theta + \Phi, 0) + \lfloor \frac{l}{\Theta} \rfloor \Phi,\tag{3.3}$$

where  is the period of TDM, and  is the length of slots allocated to the transmission.

In different modes, the schedulability of the flow set is determined as follows:

$$\sum\_{F\_l \in F} dbf\_{LO}(F\_l, l) \le sbf\_{LO}(l), \forall l \ge 0. \tag{3.4}$$

$$\sum\_{F\_l \in HI(F)} db f\_{HI}(F\_l, l) \le sb f\_{HI}(l), \forall l \ge 0. \tag{3.5}$$

Similar to real-time scheduling, the flow set is scheduled when the network is satisfied by Eqs.(3.4) and (3.5). However, in contrast to real-time scheduling, there are two kinds of delays in industrial wireless sensor networks, channel contention and transmission conflicts. When a transmission conflict occurs, a high-priority job will influence a low priority job, and thus, the flows are not independent.

Note that transmission conflict is a distinguishing feature in industrial wireless sensor networks that does not exist in conventional real-time processor scheduling problems. To analyze the network demand in any time interval, we must consider the delay caused by transmission conflicts.

Moreover, in mixed-criticality networks, there may be some jobs that are released but not finished at the time of the switch to high-criticality mode; we define these jobs as *carry-over jobs*. We must analyze *carry-over jobs* to tighten the demand bound of the network.

#### **3.4 Demand-Bound Function of Industrial Networks**

In this section, we analyze the network demand bound function for a singlecriticality network and mixed-criticality network. For the single-criticality network, we study the demand bound function from channel contention and transmission conflicts. On this basis, we then analyze the delay caused by *carry-over jobs* (the job that is released but not finished at the time of the switch) in the mixed-criticality network. Finally, we study the methods for tightening the network demand bound function.

#### *3.4.1 Analysis of Single-Criticality Networks*

In this subsection, we study the demand bound function under a single-criticality network in two steps. First, we formulate network transmission conflict delay with path overlaps; we then analyze the network dbf. To make our study self-contained, we present the results of the state-of-the-art demand bound function for CPU scheduling [11, 12]. Assuming that the flows are executed on a multiprocessor platform, the channel is mapped as a processor. We can obtain the network demand caused by channel contention in any time interval *l* as

$$ddf(l)^{ch} = \frac{1}{m} \sum\_{l=1}^{n} \left[ \left( \left\lfloor \frac{l-d\_l}{t\_l} + 1 \right\rfloor \right) c\_l \right]\_0. \tag{3.6}$$

Equation (3.6) considers only the delay caused by channel contention, denoted as *dbf (l)ch*. The jobs are conflicted when their transmission paths have overlaps. As shown in Fig. 3.3, the priority of the job in *Fi* is higher than the one in *Fj* , so the job in *Fj* may be delayed by in *Fi* at nodes *V* and *V*<sup>1</sup> to *Vh* (we assume the network is connected and do not consider the case where the path disconnects).

Transmission conflicts are generated at the path overlaps, and the network requires more resources to solve the transmission conflicts. To obtain *dbf (l)* of the network, we must first study the relationship between conflict delay and path overlap. However, estimation transmission conflict delay by the length of the overlap is often a pessimistic method. As shown in Fig. 3.3, the delay is much smaller than the length of the path overlap. To avoid pessimistic estimation, we introduce the result proposed by Saifullah in [13]. The length of the *k*th path overlap is denoted as *Lenk(ij )*, and its conflict delay is *Dk(ij )*. For the overlap as *V*<sup>1</sup> → *...Vh*, if there exists node *u, w* ∈ *V* such that *u* → *V*<sup>1</sup> → *...Vh* → *w* is also on *Fi*'s route, then *Lenk(ij )* = *h* + 1. If only *u* or only *w* exists, then *Lenk(ij )* = *h*. If neither *u* nor *v* exists, then *Lenk(ij )* = *h* − 1. In our example, *Len*1*(ij )* = 2, *Len*2*(ij )* = 7 and *D(ij )* = *D*1*(ij )* + *D*2*(ij )*, which is at most 2 + 3 = 5. Obviously, *Lenk(ij )* is the upper bound of *Dk (ij )*, which means *Lenk(ij )* ≥ *Dk(ij )*. For the flow set *F*, the total delay caused by transmission conflicts is

$$\Delta = \sum\_{1 \le l, j \le n} D\_k(ij) \le \sum\_{1 \le l, j \le n} Len\_k(ij). \tag{3.7}$$

By the Lemma proposed in [13], the estimation of the delay caused by overlap with a length of at least 4 can be tightened. We then formulate the total transmission conflicts between *Fi* and *Fj* as

$$\Delta(ij) = \sum\_{k=1}^{\delta(lj)} len\_k(ij) - \sum\_{k'=1}^{\delta'(lj)} (Len\_{k'}(ij) - \mathfrak{Z}),\tag{3.8}$$

where *δ(ij )* is the number of path overlaps, *δ (ij )* is the number of paths overlap with a length of at least 4. Because all flows have a periodic duty, we denote *T* as the least common multiple of flow set *F* (because the period is an integral multiple of 2, *T* is equal to the longest period among *F*). Network *dbf* changes with time interval *l* while it slides from 0 to *T* . However, Lemma 3.2 proposed by Saifullah is scheduled under fixed priority, so the priorities of flows are variable under EDF scheduling. We must analyze whether Saifullah's result is suitable under EDF scheduling. We denote the *m*th job generated by *Fi* as *F <sup>m</sup> <sup>i</sup>* , and our objective is to estimate the delay caused by transmission conflicts by analyzing the number of conflicts.

**Lemma 3.1** *F<sup>k</sup> <sup>i</sup> and <sup>F</sup><sup>g</sup> <sup>j</sup> are two jobs of flow <sup>i</sup> and <sup>j</sup> , when <sup>F</sup><sup>k</sup> <sup>i</sup> and <sup>F</sup><sup>g</sup> <sup>j</sup> ( <sup>F</sup><sup>k</sup> i* ∈ *hp(F<sup>g</sup> <sup>j</sup> ) ) conflict, the job <sup>F</sup><sup>k</sup> <sup>i</sup> will never be blocked by the job <sup>F</sup>g*+*<sup>m</sup> <sup>j</sup> . However, <sup>F</sup>k*+*<sup>m</sup> <sup>i</sup> may be blocked by <sup>F</sup><sup>g</sup> j .*

*Proof* At the beginning, the priority of *F<sup>k</sup> <sup>i</sup>* is higher than *<sup>F</sup><sup>g</sup> <sup>j</sup>* , which means *<sup>d</sup><sup>k</sup> <sup>i</sup> < d<sup>k</sup> j* . As Fig. 3.3 shows, two flows may conflict at *V*1, and *Fj* is delayed by *Fi*. When *F<sup>k</sup> i* is forwarded to *Vh*, two jobs may conflict again. If *F<sup>k</sup> <sup>i</sup>* is blocked by *<sup>F</sup>k*+*<sup>m</sup> <sup>j</sup>* , we can obtain *d<sup>k</sup> <sup>i</sup> > dg*+*<sup>m</sup> <sup>j</sup>* . Because *<sup>d</sup>g*+*<sup>m</sup> <sup>j</sup> > d<sup>g</sup> <sup>j</sup>* , this contradicts with *<sup>d</sup><sup>k</sup> <sup>i</sup> < d<sup>g</sup> <sup>j</sup>* . Hence, *<sup>F</sup><sup>k</sup> i* will never be blocked by *Fg*+*<sup>m</sup> <sup>j</sup>* .

We prove that *<sup>F</sup>k*+*<sup>m</sup> <sup>i</sup>* is blocked by *<sup>F</sup><sup>g</sup> <sup>j</sup>* through an example. We use the following simple flow set: *F*<sup>1</sup> = {*c*<sup>1</sup> = 1*, d*<sup>1</sup> = *t*<sup>1</sup> = 2} and *F*<sup>2</sup> = {*c*<sup>2</sup> = 1*, d*<sup>2</sup> = *t*<sup>2</sup> = 3}.

At the beginning, the priority of *F*<sup>1</sup> <sup>1</sup> is higher than *<sup>F</sup>*<sup>1</sup> <sup>2</sup> , because the absolute deadline is 2 and 3, respectively. At time slot 2, another job is generated by *F*<sup>1</sup> with the absolute deadline of 2. However, the absolute deadline of *F*<sup>1</sup> <sup>2</sup> is 1, *<sup>F</sup>*<sup>2</sup> <sup>1</sup> is blocked by *F*<sup>1</sup> <sup>2</sup> . Hence, *<sup>F</sup>k*+*<sup>m</sup> <sup>i</sup>* can be blocked by *<sup>F</sup><sup>g</sup> <sup>j</sup>* .

Because a path is a chain of transmissions from source to destination, in considering the conflict delay caused by multiple jobs of *Fi* on flow *Fj* , we analyze the number of conflicts for *Fi* and *Fj* . Thus, Lemma 3.2 establishes the upper bound of this value.

**Lemma 3.2** *When Fj and Fi conflict, within any time interval of length l, each job of Fj can be blocked no more than <sup>l</sup> ti times, and Fj can be blocked by Fj no more than <sup>l</sup> tj times.*

*Proof* Based on Lemma 3.1, we know that the priority inversion will occur in the process of transmission. If *F<sup>k</sup> <sup>i</sup>* is a higher-priority job than *<sup>F</sup><sup>g</sup> <sup>j</sup>* , the jobs released after *F<sup>g</sup> <sup>j</sup>* must be blocked by *<sup>F</sup><sup>k</sup> <sup>i</sup>* until *<sup>F</sup><sup>k</sup> <sup>i</sup>* is finished. If all jobs generated by *Fi* satisfy *d <sup>k</sup>*+ *<sup>l</sup> t i <sup>i</sup> < d<sup>g</sup> <sup>j</sup>* , where *k* and *g* are the first jobs for *Fi* and *Fj* , respectively, in *<sup>l</sup>*, then there are no more than *<sup>l</sup> ti* jobs of *Fi*. Beyond that, because there is no transmission conflict, the other jobs of *Fj* are not blocked by *Fi*. Hence, *Fj* can be blocked by *Fi* no more than *<sup>l</sup> ti* times. The same as *Fi*, *Fi* can be blocked by *Fj* no more than *<sup>l</sup> tj* times.

By Lemmas 3.1 and 3.2, we can estimate the network demand caused by the transmission conflict. Based on Eq.(3.6), we obtain the upper bound of *dbf (l)* as follows:

**Theorem 3.1** *In any time interval of length l, the demand bound function under a single-critical network (low-criticality mode) is upper-bounded by*

$$ddbf\_{LO}(l) = \frac{1}{m} \sum\_{l=1}^{n} \left[ \left( \left\lfloor \frac{l-d\_l}{t\_l} + 1 \right\rfloor \right) c\_l \right]\_0 + \sum\_{1 \le l, j \le n} (\Delta(ij) \max\{\lceil \frac{l}{t\_l} \rceil, \lceil \frac{l}{t\_j} \rceil\)). \tag{3.9}$$

*Proof* Network demand is the upper bound in a time interval of length l, which consists of two parts, channel contention and transmission conflict. The demand of channel contention is bounded by Eq.(3.6). For the demand of the transmission conflict, we first analyze each time conflict delay for every two paths by Eq.(3.8); the number of conflicts can then be obtained by Lemma 3.2. We can obtain the network demand of transmission conflict as

$$\sum\_{1 \le i,j \le n} (\Delta(ij) \max\{\lceil \frac{l}{t\_i} \rceil, \lceil \frac{l}{t\_j} \rceil\}).\tag{3.10}$$

Hence, we can obtain the demand bound function under a single-critical network upper-bounded by Eq.(3.9).

#### *3.4.2 Analysis of Mixed-Criticality Networks*

Based on the result proposed in Sect. 3.4.1, we extend the idea of a demand bound function to a mixed-criticality network. For illustration purposes, only a dual-criticality network is considered; this means that *ξ* has only two values, *LO* (low-criticality mode) and *H I* (high-criticality mode). Nevertheless, it can be easily extended to networks with an arbitrary number of criticality modes. We construct three demand bound functions: the demand bound function in low- and highcriticality modes (*dbfLO(l)* and *dbfH I (l)* ) and the demand bound function when network mode switches (*dbfLO*2*H I (l)*). We analyze *dbfH I (l)* and *dbfLO*2*H I (l)* under graph routing in this subsection.

The network begins from the low-criticality level, and all flows are served and executed as in a single-criticality network. When errors or emergencies occur, the centralized network manager will trigger the switching of the network mode from *LO* to *H I* . In high-criticality mode, the network turns to graph routing, and the flows in the low-criticality level are discarded; only high-criticality flows can be delivered. The job that is active (released, but not finished) from a high-criticality flow at the time of the switch is still running under source routing; *nH I* is the number of high-criticality flows, and there are no more than *nH I carry-over jobs* that are active at the time of the switch. We define these *carry-over jobs* as new flows *F(nH I* <sup>+</sup><sup>1</sup>*), F(nH I* <sup>+</sup>2*) ...F*2*nH I* , which have the same characters as the corresponding flows in *F* except for *c* and *t*. For the new flow *Fp*+*nH I* , *cp > c(p*+*nH I )*, and as an accidental event, *t(p*+*nH I ) tp*.

When the network switches from *LO* to *H I* , the demand of *carry-over jobs* is

$$\frac{1}{m} \sum\_{p=1+nHI}^{2n\_{HI}} c\_p + \sum\_{n\_{HI} \le p,q \le 2n\_{HI}} \Delta(pq). \tag{3.11}$$

Furthermore, the flows will generate new jobs when the network switches to high-criticality mode. Because each node except the destination on the primary path generates one backup path, the total number of paths for *Fp* is *cp* + 1 and the execution time for each backup path *c<sup>k</sup> <sup>p</sup>* can be obtained from the network easily. The total execution time of *Fi* can be denoted as *Cp* <sup>=</sup> *cp* <sup>+</sup> *cp <sup>k</sup>*=<sup>1</sup> *<sup>c</sup><sup>k</sup> <sup>p</sup>*. Therefore, network demand for channel contention under graph routing is

$$db f\_{HI}^{ch}(l) = \frac{2}{m} \sum\_{p=1}^{n\_{HI}} \left[ ( \left\lfloor \frac{l - d\_p}{t\_p} + 1 \right\rfloor ) C\_p \right]\_0. \tag{3.12}$$

Based on the rules of transmission conflict proposed in Sect. 3.2.3, a transmission conflict between two flows is generated only if there is at least one flow transmission on the primary path. Therefore, we analyze *dbfH I (l)* by studying the transmission conflict generated on the primary path. For *F<sup>g</sup> <sup>p</sup>* and *F <sup>m</sup> <sup>q</sup>* , when given *dp < dq*, *F <sup>m</sup> q* may be delayed by *F<sup>g</sup> <sup>p</sup>* and its backup paths. We denote the path set of *Fp* and its backup paths as *I* ; each path in *I* is denoted as *p* . The upper bound delay of *F <sup>m</sup> q* caused by *F<sup>g</sup> <sup>p</sup>* is denoted as *(p q)*. *(p q)* can be formulated as

$$\Delta(p'q) = \sum\_{p'=1}^{c\_{\mathcal{P}}+1} (\sum\_{k=1}^{\delta(p'q)} len\_k(p'q) - \sum\_{k'=1}^{\delta'(p'q)} (Len\_{k'}(p'q) - \mathfrak{Z})).\tag{3.13}$$

For the job on the backup path, a transmission delay occurs only when it conflicts with primary paths with high-priority jobs. When we reverse the priority of *F<sup>g</sup> <sup>p</sup>* and *F <sup>m</sup> <sup>q</sup>* , Eq.(3.13) is the upper bound additional demand of *<sup>F</sup><sup>g</sup> <sup>p</sup>* caused by *F <sup>m</sup> <sup>q</sup>* . From the above, the network upper bound demand function under graph routing can be described as

$$
abla f\_{HI}(l) = \frac{2}{m} \sum\_{i=1}^{n\_{HI}} \left\| \left( \left\lfloor \frac{l-d\_l}{t\_l} + 1 \right\rfloor \right) C\_l \right\|\_0$$

$$+ \sum\_{1 \le p,q \le n\_{HI}} (\Delta(p'q) \max\{\lceil \frac{l}{t\_p} \rceil, \lceil \frac{l}{t\_q} \rceil\}).\tag{3.14}$$

We can then obtain *dbfLO*2*H I (l)* as

$$dbf\_{LO2HI}(l) = \frac{2}{m} \sum\_{p=1}^{nHI} (\left\lceil \left( \frac{l - d\_p}{t\_p} + 1 \right) \right\rceil C\_p + \frac{1}{2} c\_p) \right\rceil\_0$$

$$+ \sum\_{1 \le p, q \le 2nHI} (\Delta(p'q) \max\{\lceil \frac{l}{t\_p} \rceil, \lceil \frac{l}{t\_q} \rceil\}). \tag{3.15}$$

Because transmission on a backup path occurs only when the two previous attempts fail, when the transmission success rate on the primary path satisfies the network packet reception ratio, the sender has no need to send a backup packet. Hence, the network upper bound demand function in this case can be rewritten as

$$dbf\_{LO2HI}(l) = \frac{3}{m} \sum\_{p=1}^{nHI} \left[ \left( \left\lfloor \frac{l-d\_p}{t\_p} + 1 \right\rfloor \right) c\_p \right]\_0$$

$$+ \sum\_{1 \le p,q \le 2n\_{HI}} (\Delta(pq) \max\{\lceil \frac{l}{t\_p} \rceil, \lceil \frac{l}{t\_q} \rceil\}).\tag{3.16}$$

#### *3.4.3 Tightening the Demand Bound Functions*

A loose demand bound function will lead to a pessimistic estimation of network schedulability. In this subsection, we tighten our demand bound functions by discussing the relationship between two flows and transmission conflict.

In our previous analysis Lemma 3.2, the number of conflict jobs is a conservative estimation as max{ *<sup>l</sup> ti , <sup>l</sup> tj* }. However, this value can be reduced by classifying discussions. We divide this value into the following categories:


When the path of *Fi* and *Fj* have overlaps, they may generate transmission conflicts. The delay caused by conflict cannot occur in each slot because the flow does not transmit between *d* and *t*. Obviously, when one flow works in its ideal time (between *d* and *t*), there is no transmission conflict between *Fi* and *Fj* .

Condition 1 is shown in Fig. 3.4a; conflict occurs only when both *Fi* and *Fj* have job transmissions on the path. For a given *l*, the number of conflicting jobs can be expressed as

$$\mathbb{I}\left[\frac{l}{t\_j}\mathbb{I}(\lfloor\frac{d\_j}{t\_l}\rfloor+1).\right.\tag{3.17}$$

Similarly, we can obtain the number of conflicting jobs in condition 2 as

$$\mathbb{E}\frac{l}{t\_j}\mathbb{I}(\lfloor\frac{d\_j}{t\_l}\rfloor+1) = 2\lceil\frac{l}{t\_j}\rceil.\tag{3.18}$$

We denote the number of conflicts as *Num(ij )*. When we know each flow's routing information, the estimation of *Num(ij )* can be further precise. By taking the modulus of *dj ti* , we can estimate the maximum length of *Fi*'s residual path as



The number of conflicts can be expressed as

$$Num(ij) = \lceil \frac{l}{t\_j} \rceil (\lfloor \frac{d\_j}{t\_l} \rfloor + \psi). \tag{3.19}$$

We can then obtain the network demand bound functions as follows:

**Theorem 3.2** *In any time interval of length l, the demand bound function in each mode can be expressed as*

$$dbf\_{LO}(l) = \frac{1}{m} \sum\_{l=1}^{n} \left[ \left( \left\lfloor \frac{l-d\_l}{t\_l} + 1 \right\rfloor \right) c\_l \right]\_0 + \sum\_{1 \le l, j \le n} (\Delta(ij)Num(ij)). \tag{3.20}$$

$$dbf\_{LO2HI}(l) = \frac{2}{m} \sum\_{p=1}^{nHI} (\left\lceil \left(\frac{l-d\_p}{t\_p} + 1\right) (C\_p + \frac{1}{2}c\_p) \right\rceil\_0$$

$$+\sum\_{1\le p,q\le 2n\_{HI}} (\Delta(p'q)Num(pq)).\tag{3.21}$$

$$ddbf\_{HI}(l) = \frac{2}{m} \sum\_{p=1}^{n\_{HI}} (\left\| \left( \left\lfloor \frac{l-d\_p}{t\_P} + 1 \right\rfloor \right) C\_P \right\|\right)\_0 + \sum\_{1 \le p,q \le 2n\_{HI}} (\Delta(p'q)Num(pq)). \tag{3.22}$$

*The network demand bound function is dbf (l)* = max{*dbfLO(l), dbfLO*2*H I (l), dbfH I (l)*}*, and the network can be scheduled when dbf (l) is no less than* min {*dbfLO(l), dbfLO*2*H I (l)*}*.*

*Proof* The proofs of demand bound functions are similar to in Theorem 3.1. The difference is that we reduce the number of conflicts by classifying the discussion, and the demand bound functions are tightened. Because there are *carry-over jobs* at the switching time, *dbfLO*2*H I (l)* must be greater than *dbfH I (l)*. When the network supply in a time interval of length *l sbf (l)* is larger than *dbfLO(l)*, the network can be scheduled in low-criticality mode; when *dbfLO*2*H I (l)* ≤ *sbf (l) < dbfLO(l)*, the network can be scheduled in high-criticality mode; when *sbf (l) >* max{*dbfLO(l), dbfLO*2*H I (l)*}, the network cannot be scheduled. Hence, the network can be scheduled when *dbf (l)* is no less than min{*dbfLO(l), dbfLO*2*H I (l)*}.

#### **3.5 Performance Evaluations**

In this section, we conduct experiments to evaluate the performance of our proposed methods. Our method is first compared with the simulation result. We then compare our method with the supply/demand bound function analysis without tightening.

To illustrate the applicability of our method, for each parameter configuration, several test cases are generated randomly. For each test case, the network gateway is placed at the center of playground area *A*, and the other nodes are deployed randomly around the gateway. According to the suggestion in [14], given the transmitting range *d* = 40 m, the number of nodes *n* and the playground area *A* should satisfy

$$\frac{n}{A} = \frac{2\pi}{d^2\sqrt{27}}.\tag{3.23}$$

If two nodes can communicate with each other, which means that the distance between two nodes is less than *d*, they are adjacent nodes. By repeatedly connecting the nearest node from the source node to the gateway, the network topology can be obtained. If some source nodes cannot connect to the gateway, their locations are generated randomly again.

**Fig. 3.5** Relationship between demand bound functions and supply bound function

Our simulations use the utilization *u* to control the workload of the entire network. To make flow sets available, we specify the network utilization *U* = *ui*(*U <* 1), and the UUniFast algorithm [15] is used to generate each flow's utilization *ui* (*ui* <sup>=</sup> *ci ti* ). The result generated by the UUniFast algorithm follows a uniform distribution and is neither pessimistic nor optimistic for the analysis [15].

Figure 3.5 is an example of the relationship between the demand bound function in different criticality modes and the supply bound function. In this example, according to the actual situation, we set the number of nodes as *n* = 70 and the number of flows as *F* = 20. At the beginning, with the network running in low-criticality mode, the demand is zero. At time slot 5, *DBF LO* is 72, which is larger than the upper bound of network supply; the network then switches to high-criticality mode. Considering *carry-over jobs*, we can calculate the demand in high-criticality mode from time slot 5. Because the network demand is less than the supply, this example is a stable network. Furthermore, Fig. 3.5 reveals that the demand bound functions are stepwise increasing. This is because *dbf (l)* is the network demand over a period of time. When a job has enough time slots to transmit (e.g., a job is just released), its demand is zero and does not require immediate execution. With the decrease of the remaining time, the job becomes urgent. When the remaining time for the job is *c*, the job must be forwarded immediately; otherwise, it will miss the deadline. The job demand is then changed to the number of hops *c*.

Figure 3.6 is the variation tendency of *DBFH I* with the proportion of highcriticality flows. Because changing the proportion of *nH I* does not affect network demand in low-criticality mode, Fig. 3.6 shows the network demand only in highcriticality mode. Obviously, the network demand is increasing with the increasing

**Fig. 3.6** Variation tendency of *DBFHI* with the percentage of high-criticality flows

proportion of high-criticality flows. At the beginning (0.4–0.6), the network demand increases slowly. From 0.7–0.9, the demand of the network increases rapidly. This is because more flows in high-criticality mode generate more transmission conflicts in conditions 1, 2, and 4. The network needs more resources to ensure that the job meets its deadline. This phenomenon is enhanced severely with increasing *P*.

To analyze the correctness of our method, we compare the network schedulability ratio between the simulation result (denoted as MixedSim) and our method (denoted as MixedEDF) in Fig. 3.7. For each point in the figures, more than 100 test cases are randomly generated. From the figures, we can know that our algorithm can accurately evaluate the network schedulability ratio regardless of which parameters are used. Because we pessimistically estimate transmission conflicts to guarantee our method's reliability, the evaluation value of the network demand bound is larger than the actual demand. In Fig. 3.7a and b, the proportions of high-criticality flows are *P* = 0*.*4 and *P* = 0*.*5, respectively. With the increasing of nodes, the network schedulability ratio declines in both situations. However, the schedulability ratio in Fig. 3.7b falls faster than in Fig .3.7a. This is because the network generates more transmission conflicts when increasing the number of high-criticality flows. Note that compared with Fig. 3.7a, Fig. 3.7c has 0*.*1 additional utilization, so the spacing between the simulation curve and analysis curve is expanded. Although there are fluctuations between 30 to 60, our method can always bound the schedulable ratio (the fluctuations are caused by the randomly generated network environment). Because the two figures generate test cases according to the respective utilization, their test cases are different. When network utilization increases, the number of

**Fig. 3.8** Relationship between schedulability ratio and the proportion of high-criticality flows

hops from source to destination increases. This increases the number of potential conflicts. The estimation result then becomes more pessimistic.

Figure 3.8 is the relationship between the schedulability ratio and the proportion of high-criticality flows. It is easy to understand that the schedulability ratio declines with the increasing proportion of high-criticality flows. However, the spacing between the two curves changes with *P* (small–big–small). This is because our method should consider the transmission conflicts in all situations to ensure reliability. In the beginning, there are only a few conflicts in high-criticality mode. With increasing high-criticality flows, the strict estimation considers each path overlap as a transmission conflict, which leads to larger spacing between two curves. When *P* = 0*.*7, the number of conflicts increases in MixedSim, which reduces the schedulability ratio, and then the difference becomes small.

We illustrate the advantage of MixedDBF by comparing it with the supply/demand bound function analysis without tightening (denoted as MixedDBF-nt) in Fig. 3.9. Obviously, MixedDBF is better than MixedDBF-nt regardless of the conditions. With increasing network utilization or proportion of high-criticality flows, the error of MixedDBF-nt grows faster than MixedDBF. The reason is that both increasing network utilization and the number of high-criticality flows will increase the number of path overlaps. MixedDBF tightens the delay caused by the transmission conflict by Eq.(3.19). With increasing overlaps, the effect of Eq.(3.19) will be better. Hence, the error of MixedDBF-nt grows faster than MixedDBF.

#### **3.6 Summary**

WirelessHART adopts reliable graph routing to enhance network reliability. However, graph routing introduces substantial challenges in analyzing the schedulability of real-time flows. Too much transmission load will increase conflicts and reduce network performance. Disaster may happen when critical tasks miss their deadlines in this situation. Hence, firstly, we propose a novel network model that can switch routing based on the criticality mode of networks. When errors or accidents occur, the network switches to high-criticality mode and low-level critical tasks are abandoned. Secondly, we analyze the demand bound of mixed-criticality industrial wireless sensor networks under the EDF policy and formulate network demand bounds in each criticality mode. Thirdly, we tighten the demand bound by analyzing carry-over jobs and classifying the number of conflicts to improve analysis accuracy. The simulations based on random network topologies demonstrate that our method can estimate network schedulability efficiently.

#### **References**


**Open Access** This chapter is licensed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made.

The images or other third party material in this chapter are included in the chapter's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the chapter's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.

# **Chapter 4 Mixed-Criticality Scheduling for TDMA Networks**

**Abstract** To improve the schedulability of mixed-criticality industrial wireless networks, targeted algorithms should be developed. Therefore, in this chapter, we propose a mixed-criticality scheduling algorithm. The algorithm supports centralized optimization and adaptive adjustment. It can improve both the schedulability and flexibility. We conduct extensive simulations, and the results demonstrate that the proposed scheduling algorithm significantly outperforms existing ones.

#### **4.1 Background**

Since time division multiple access (TDMA) scheduling has the high predictability, it is widely used in industrial networks [1–3]. In mixed-criticality industrial wireless networks, when there are not enough resources for all data packets, the low-criticality data packets have to be discarded. Hence, almost all of mixed criticality systems must support discarding strategies [4–7]. Previous works on single-criticality industrial wireless networks apply centralized TDMA methods to guarantee the real time performance and reliability of industrial wireless networks, e.g. [8–13]. However, the centralized TDMA methods are inflexible and difficult to cope with discarding.

Intuitively, two types of methods can be used to schedule data flows in mixedcriticality wireless networks. The first type is to schedule flows based on criticality monotonic priorities. The criticality monotonic scheduling assigns the higher priority to the important flows and schedules them first. However, this method considers the criticality as the temporality. Actually, they are not equivalent. Thus, the criticality monotonic scheduling algorithm is not suitable for mixed criticality systems. This has also been demonstrated in [14]. The second type is to use the algorithms that have been proposed for previous mixed-criticality systems, such as uniprocessor/multiprocessor systems [15–17] and networks [18–20], to solve our problem. However, industrial wireless networks are different from the previous systems. To guarantee the strict requirements on the real-time performance and reliability, the main problem to be solved is how to avoid the collision and interference between parallel data flows. Mixed-criticality uniprocessor/mulitprocessor systems only consider independent processors and do not have the interference between parallel tasks. Mixed criticality wired networks and IEEE 802.11-based wireless networks are based on CSMA (Carrier Sense Multiple Access) protocols, which are unacceptable by industrial wireless networks due to the unpredictability (We give more clarifications on the differences between our system and others in Sect. 4.2). Therefore, previous algorithms cannot be used without modification in mixed criticality industrial wireless networks. In this chapter, we present a holistic scheduling solution to guarantee the real time and reliability requirements of data flows in resource-constrained industrial wireless networks. Although some flexible and scalable MAC protocols [21, 22] are adopted to improve the real-time performance and reliability of networks, they are based on only local information and cannot optimize the whole network. Therefore, our scheduling method is implemented in the application layer. According to the generated schedules, each network node transmits or receives packets in the MAC (Medium Access Control) layer. The scheduling method of the application layer can manage all data flows based on global information. Thus, it can get the optimized solution.

This chapter includes the following:

First, we propose a scheduling algorithm for mixed-criticality networks. The scheduling algorithm not only implements the optimized global management for all flows, but also reserves network resources for dynamic adjustments to enhance the real time performance and reliability of important flows. It makes a trade-off between the scheduling performance and the flexibility. Performance evaluations demonstrate that the proposed scheduling algorithm outperforms existing ones.

Second, we present a schedulability analysis for the proposed scheduling algorithm. We analyze end-to-end delay for flows, and determine whether they are all schedulable. Simulation results show that our schedulability analysis is more effective than existing ones.

#### **4.2 System Model**

Industrial wireless networks must support the strict requirements on real time performance and reliability. Therefore, we consider an industrial wireless network as follows. It consists of a gateway and some devices. We use the node set *N* = {*n*1*, n*2*,...*} to denote these nodes. The physical layer of our industrial wireless networks is specified by the IEEE 802.15.4 protocol. It supports 16 non-overlapping channels. However, due to external interference, not all of them can be accessed all of the time. We denote the number of available channels as *M* (1 ≤ *M* ≤ 16). Our network serves the flow set *F* = {*f*1*, f*2*,...*}. Each element *fi* is characterized by *< Ti, i, χi >*. Each flow *fi* periodically generates a packet at its period *Ti*, and then sends it to the destination via the routing path *i*. The relative deadline of each packet is equal to the period *Ti*, i.e., a packet is released at the time *t*, and it must be delivered to its destination before the time *(t* + *Ti* + 1*)*. In industrial wireless protocols, e.g. [23, 24], periods conform to the expression

$$b \times \mathcal{2}^a,\tag{4.1}$$

where *a* is an integer value and *b* is the unit-period.

To keep consistent with related works on mixed criticality systems, our network also supports two criticality levels, L-crit (Low criticality) and H-crit (High criticality). The dual-criticality model can be easily extended to multi-criticality model. If the flow *fi* is important, its criticality level *χi* is denoted as *H*. Otherwise, its criticality level *χi* is *L*. When the system is running in the normal mode without any exception, all flows are delivered to their destinations within deadlines. If important equipment has an exception, the corresponding data must be submitted frequently and via two paths to avoid faults on a single path. Thus, in our system model, the H-crit flows have two parameter sets: the L-crit parameters *< Ti(L), i(L) >* in the normal mode; the H-crit parameters *< Ti(H ), i(H ) >* in the exception mode, and *Ti(H )* ≤ *Ti(L)*. *i(L)* is a path that is used by the H-crit flow in the normal mode. *i(H )* contains two paths that are used by the H-crit flow in the exception mode, and the two paths transmit the same packet to improve the reliability. In order to clearly distinguish these paths, they are denoted as *i(L)* = {*π*<sup>∗</sup> *<sup>i</sup>* } and *i(H )* = {*π i, π <sup>i</sup>* }. The path *π*<sup>∗</sup> *<sup>i</sup>* (and *π <sup>i</sup>*, *π <sup>i</sup>* ) is the set of links from the source to the destination. In this chapter, we do not consider how to select routing paths. We assume all paths have been given before generating schedules. The dynamism this chapter addresses refers to using different parameters in different modes. Transmitting a packet through the *j* -th link of the path *π*∗ *<sup>i</sup>* (or *π <sup>i</sup>*, *π <sup>i</sup>* ) is called as the transmission *τ* ∗ *ij* (and *τ ij* , *τ ij* ). Each transmission has two attributes *< nα, nβ >*, which denote the transmission's source and destination respectively. As the constrained resources must provide enough services to H-crit flows, the Lcrit flows cannot be transmitted when exceptions happen. Therefore, L-crit flows only have a parameter set *< Ti(L), i(L) >*.

To improve the reliability of industrial networks, we adopt the TDMA scheme in the MAC layer. The network manager, which is connected to the gateway, assigns a time slot and a channel offset to each transmission. A transmission only is scheduled at the given time slot and on the given channel offset. Packets are generated periodically, and the schedules of corresponding transmissions have the same period. The schedules with the same period are organized within a *superframe* [24]. Transmitting a packet from the source to the destination has to be done in a superframe. Thus, superframes repeat themselves periodically, and then flows can be transmitted successfully. Figure 4.1a shows a simple network, which contains two flows *f*<sup>1</sup> and *f*2. When the system is in normal mode, the flows use their Lcrit parameters. Their periods are 8 time slots and 4 time slots, and their paths are {*e*52*, e*21} and {*e*98*, e*87*, e*74*, e*41}, where *eij* denotes the link from the node *ni* to the node *nj* . Figure 4.1b shows their superframes with different periods. *CH* and *T S* denote Channel Offset and Time slot.

**Fig. 4.1** Graph routing and superframe. (**a**) A network. (**b**) Superframes with different periods. (**c**) A hyper-frame. (**d**) The flow *f*<sup>2</sup> steal slots from the flow *f*<sup>1</sup>

Two types of improper schedules will lead to transmission interference, which seriously affects the network reliability. The first type, called *node interference*, is that more than one transmissions uses the same node at the same time slot. Each node is only equipped with one transmitter. Therefore, one node cannot serve more than one transmissions at the same time. The second type is called *scheduling interference* which means that more than one transmissions is scheduled at the same time slot and on the same channel. These overlapping transmissions cannot be separated. To avoid transmission interference between different superframes, we consider all superframes as a hyper-frame whose period is the lowest common multiple of all superframes. According to the period's Expression (4.1), the hyperperiod *T* = *LCM(T*1*, T*2*, . . .)* = max ∀*fi*∈*F* {*Ti*}. Figure 4.1c shows the hyper-frame of the simple example. We only consider how to schedule flows in the first hyperperiod, since after that, all schedules are repeated periodically. The network manager generates all schedules under two situations: Situation 1: when the network is deployed; and Situation 2: when the deployment is changed. Due to the requirement of industrial applications being fixed, the deployment is not often changed. Thus, the schedules may be generated several times, but not frequently. According to this schedule information, it obtains the working modes of each node at every time slot, and then delivers them to the corresponding nodes. For the schedules in Fig. 4.1c, from *T S*1 to *T S*4, working modes of the node *n*<sup>2</sup> are {receive, send, idle, idle}.

When a node intends to send a transmission of L-crit flows, it waits for a constant time and then listens to whether its channel is used. If the channel is used by H-crit flows, the node discards its transmission. Otherwise, the node sends the transmission. Note that although the node uses the carrier sense technique to determine whether an L-crit transmission is discarded or not, it is different from the CSMA scheme. For L-crit flows, the node performs carrier sense within time slots of the TDMA frame. If the L-crit transmission is not discarded, it is also scheduled based on the TDMA scheme. When a node intends to send a transmission of Hcrit flows, it immediately sends it at the beginning of the assigned time slot. The scheduling algorithm assigns the proper time slot and channel for each transmission and prevents H-crit transmissions from interfering with other H-crit transmissions. Therefore, H-crit transmissions are sent directly without checking the channel. In this way, the H-crit flow can steal slots from L-crit flows when it needs more resources to cope with exceptions [25]. Note that the H-crit flow using H-crit parameters is not permitted to steal slots that are used by any other H-crit flows even if these H-crit flows are using L-crit parameters. Figure 4.1d shows an example of mixed-criticality schedules. The period of the H-crit flow *f*<sup>1</sup> is changed from 8 to 4, and the new path {*e*56*, e*63*, e*31} begins to be used. In this case, there are not enough time slots. The H-cirt transmission 3 → 1 (the solid line in Fig. 4.1d) steals the resource of the L-cirt transmission 7 → 4. Based on the stealing strategy, the dynamic adjustment can be supported.

The *schedulable* flow set is defined as follows. When the system is in the normal mode, the flow set is schedulable if all flows characterized by L-crit parameters can hit their deadlines. When there are exceptions in the system, the flow set is schedulable if all H-crit flows can hit their deadlines no matter which parameters they are using.

#### **4.3 Problem Statement**

Based on the above system model, we describe the mixed criticality scheduling problem as follows. Given the network and the flow set *F*, our objective is to schedule transmissions in the time slot and channel dimensions such that the flow set is schedulable.

To explain the problem more clearly, we formulate the problem as a Satisfiability Modulo Theories (SMT) specification. The transmission *τ* ∗ *ij* (and *τ ij* , *τ ij* ) is assigned the *s*∗ *ij* -th (and *s ij* -th, *s ij* -th) time slot and the *r*<sup>∗</sup> *ij* -th (and *r ij* -th, *r ij* -th) channel offset. Note that a transmission is scheduled periodically. Therefore, the transmission uses all of the time slots *sij* + *g* · *Ti (*∀*g* ∈ [0*, <sup>T</sup> Ti ))* in a hyper-frame. These assignments must respect the following constraints.

#### (a) **Channel Offset Constraint**.

$$\forall f\_i, \forall j \in [1, |\pi\_l^\*|], 1 \le r\_{lj}^\* \le M$$

For each transmission, its assigned channel offset must be in *M* available channels. This expression is for transmissions in the path *π*∗ *<sup>i</sup>* . Other transmissions *τ ij* and *τ ij* in paths *π <sup>i</sup>* and *π <sup>i</sup>* have the same constraint, and we omit them for simplicity.

#### (b) **Releasing Sequence Constraint**.

$$\forall j \dot{\imath}, \forall j \in \{1, |\pi\_{\dot{\imath}}^{\*}| - 1\}, s\_{\dot{\imath}, j}^{\*} < s\_{\dot{\imath}, j+1}^{\*}$$

In a routing path, the transmission *τi,j*+<sup>1</sup> is released after the transmission *τi,j* is scheduled. We still omit paths *π <sup>i</sup>* and *π i* .

(c) **Real Time Constraint**.

$$\forall f\_l, \ 1 \le s\_{l, |\pi\_l^\*|}^\* \le T\_l(L).$$

All transmissions cannot miss deadlines. Likewise, *s i,*|*π <sup>i</sup>* <sup>|</sup> and *<sup>s</sup> i,*|*π <sup>i</sup>* <sup>|</sup> have the same constraint.

(d) **Interference Constraint**. Assigning resources to transmissions must prevent the happening of node interference and scheduling interference. We use *δ(τa, τb)* to denote whether there exists interference between *τa* and *τb*,

$$(\delta(\mathfrak{r}\_a, \mathfrak{r}\_b) = (\mathfrak{r}\_a \cap \mathfrak{r}\_b = \emptyset) ? (\eta(\mathfrak{s}\_a, \mathfrak{s}\_b) \wedge (r\_a = r\_b)) : \eta(\mathfrak{s}\_a, \mathfrak{s}\_b),$$

where *η(sa, sb)* =  ∀*h*∈[0*, <sup>T</sup> Ta ),*∀*k*∈[0*, <sup>T</sup> Tb ) (sa* + *h* · *Ta* = *sb* + *k* · *Tb)* means whether

the assigned time slots of *τa* and *τb* overlap each other. If the two transmissions do not use the same node, i.e., *τa* ∩ *τb* = ∅, then they can be scheduled at different time slots or on the different channel offsets. Otherwise, there exists node interference and they cannot be scheduled at the same time slot. The transmissions of the H-crit flow *fi* are classified into three sets <sup>∗</sup> *<sup>i</sup>* = {*τ* <sup>∗</sup> *ij* |∀*j* ∈ [1*,*|*π*<sup>∗</sup> *<sup>i</sup>* |]}, *<sup>i</sup>* = {*τ ij* |∀*j* ∈ [1*,*|*π <sup>i</sup>*|]} and *<sup>i</sup>* = {*τ ij* |∀*j* ∈ [1*,*|*π <sup>i</sup>* |]}. For the L-cirt flow *fi*, *<sup>i</sup>* = *<sup>i</sup>* = ∅, and then ∀*fi* ∈ *F,i* = <sup>∗</sup> *<sup>i</sup>* ∪ *<sup>i</sup>* ∪ *<sup>i</sup>* . Thus, the interference constraints in the normal mode and exception mode are as follows.

(d.1) Normal mode

$$\forall \mathfrak{r}\_a, \mathfrak{r}\_b \in \bigvee\_{\forall f\_l \in F} \Gamma\_l^\*, \delta(\mathfrak{r}\_a, \mathfrak{r}\_b) = 0$$

(d.2) Exception mode

$$\forall f\_l, \, f\_\mathcal{g} \in F, \, \chi\_l = \chi\_\mathcal{g} = H, \forall \tau\_a \in \Gamma\_l, \forall \tau\_b \in \Gamma\_\mathcal{g}, \, \delta(\tau\_a, \tau\_b) = 0$$

The mixed criticality scheduling problem is NP-hard [26]. Our SMT specification can be solved by some solvers, such as Z3 [27] and Yices [28]. These solvers can find satisfying assignments for quite many problems, and their solutions have been an excellent standard to evaluate the effectiveness of other methods [29]. However, the running time may be unacceptable for complex networks and flow sets. Therefore, we propose a heuristic scheduling algorithm in Sect. 4.4 to solve the problem.

#### **4.4 Scheduling Algorithm**

In this section, we first introduce how to schedule transmissions, and then, based on these schedules, we determine working modes of each node at every time slot.

#### *4.4.1 A Slot-Stealing Scheduling Algorithm*

We propose a slot-stealing scheduling algorithm based on RM (StealRM). The proposed StealRM optimizes the solution according to the global information, and permits transmissions to share the same resource when the transmissions have different levels of criticality. Hence, the schedules can be adaptively adjusted based on the requirements of H-crit flows.

The proposed StealRM is shown in Algorithm 4.1. Each flow is assigned as the RM priority. If two flows have the same RM priority, the flow with the smaller ID has the higher priority. The transmission's priority is equal to its flow's priority. The set *R* contains all of schedulable transmissions (lines 1 and 19), and the set *R* denotes released transmissions at the current time slot (line 3). At every time slot *t*, we first sort elements of *R* according to the decreasing order of priorities, and *τ*<sup>1</sup> in the set *R* has the highest priority (line 4). Then, for each transmission *τa* in the set *R* , we check whether it can be scheduled at the current time slot without any interference (lines 7–23). Let *F(τa)* denote the flow that the transmission *τa* belongs to (line 6). The set *Y HL <sup>t</sup>* contains the transmissions that have been scheduled at the time slot *t* and belong to H-crit flows with L-crit parameters. The sets *Y <sup>H</sup> <sup>t</sup>* and *Y <sup>L</sup> <sup>t</sup>* correspond to those in H-crit flows with H-crit parameters and L-crit flows, respectively. The transmissions in the set *Y* and the transmission *τa* cannot steal slots from each other. According to the criticality level of *τa*, the set *Y* is assigned different transmissions (lines 7–13). If the transmission *τa* belongs to an H-crit flow with H-crit parameters, then it cannot steal slots from other H-crit transmissions (lines 7–8). *Y <sup>H</sup>* and *Y HL* may contain the transmissions belonging to the same flow with *τa*. These transmissions do not interfere the scheduling of *τa*. Thus, the set {∀*τ* <sup>∗</sup> *ig*} needs to be excluded from *<sup>Y</sup> <sup>H</sup>* and *<sup>Y</sup> HL* (line 8). Similarly, if the transmission *τa* belongs to an H-crit flow with L-crit parameters, then it cannot steal slots from any other transmissions (lines 9 and 10). If the transmission *τa* belongs to an Lcrit flow, then its slots cannot be stolen by L-crit flows and H-crit flows with L-crit parameters (lines 11 and 13). When there is no node interference between *τa* and *Y* , and at least one channel is idle (line 14), the transmission *τa* can be scheduled at this current time slot. *(Y )* denotes the channels that have been used by *Y* . However, if the current time slot has exceeded its deadline, the flow set is unschedulable (lines 15 and 16). Otherwise, the time slot and channel offset of the transmission *τa* are assigned (line 18), and the schedulable transmission set *R* and the scheduled transmission set *Y <sup>H</sup> <sup>t</sup>* (*Y <sup>L</sup> <sup>t</sup>* and *Y HL <sup>t</sup>* ) are updated (lines 19–26).

The number of iterations of the **for** loop in line 2 and the **for** loop in line 5 is *O(*|*T* |*)* and *O(*||*)*, respectively. The complexity of line 4, line 14 and line 21 is *O(*||*log*||*)*, *O(*||*)* and *O( <sup>T</sup> Tmin )*, respectively. Therefore, the time complexity of Algorithm 4.1 is *O(*|*T* ||| 2 *T Tmin )*.

#### *4.4.2 Node Working Mode*

Nodes have three working modes, including transmit mode (S), receive mode (R) and idle mode. We use *w<sup>H</sup> α,t* <sup>=</sup>*<sup>&</sup>lt;* <sup>S</sup> (or <sup>R</sup>*), ra <sup>&</sup>gt;* to denote that at the time slot *<sup>t</sup>* the node *nα* transmits (or receives) H-crit flows on the channel *ra*. Similarly, *w<sup>L</sup> α,t* denotes that the node *nα* serves L-crit flows. Algorithm 4.2 determines the working mode for each node. For each transmission, we have assigned a time slot and a channel offset in Algorithm 4.1. According to the assignments, the working modes of the sender node and receiver node of the transmission can be obtained (lines between 4 and 10). The time complexity of Algorithm 4.2 is *O(*|| *<sup>T</sup> Tmin )*.

Note that a node may serve two flows at the same time slot, but the two flows must have different criticality levels. Otherwise, node interference occurs. At the beginning of the time slot *t*, the node works in mode *w<sup>H</sup> α,t* . Then, in a constant time if it needs to send an H-crit flow or has received a flow, it continues working in the

#### **Algorithm 4.1** StealRM

**Input:** the flow set *F* **Output:** the scheduling results ∀*sa* and ∀*ra* ; 1: the schedulable transmission set *R* ← {*τ* <sup>∗</sup> *<sup>i</sup>*1*, τ <sup>i</sup>*1*, τ <sup>i</sup>*1|∀*fi* ∈ *F*}; 2: **for** ∀*t* ∈ [1*, T* ] **do** 3: *R* ← *R*; 4: sort *R* according to the decreasing order of priorities; 5: **for** each *a* from 1 to |*R* | **do** 6: *i* ← *F(τa)*; 7: **if** *χi* == *H* and *τa* ∈ *<sup>i</sup>* ∪ *<sup>i</sup>* **then** 8: *Y* ← ∪ ∀*h*∈[0*, <sup>T</sup> Ti(H ) ) (Y <sup>H</sup> <sup>t</sup>*+*Ti(H )*×*<sup>h</sup>* <sup>∪</sup> *<sup>Y</sup> HL <sup>t</sup>*+*Ti(H )*×*h)* − {∀*<sup>τ</sup>* <sup>∗</sup> *ig*}; 9: **else if** *χi* == *H* and *τa* ∈ <sup>∗</sup> *<sup>i</sup>* **then** 10: *<sup>Y</sup>* <sup>←</sup> *(* <sup>∪</sup> <sup>∀</sup>*h*∈[0*, <sup>T</sup> Ti(L) ) Y <sup>L</sup> <sup>t</sup>*+*Ti(L)*×*h)*∪*(* <sup>∪</sup> <sup>∀</sup>*h*∈[0*, <sup>T</sup> Ti(H ) ) (Y <sup>H</sup> <sup>t</sup>*+*Ti(H )*×*h*∪*<sup>Y</sup> HL <sup>t</sup>*+*Ti(H )*×*h))*−{∀*<sup>τ</sup> ig, τ ig*}; 11: **else** 12: *<sup>Y</sup>* <sup>←</sup> *(* <sup>∪</sup> <sup>∀</sup>*h*∈[0*, <sup>T</sup> Ti(L) ) Y <sup>L</sup> <sup>t</sup>*+*Ti(L)*×*h)* <sup>∪</sup> *(* <sup>∪</sup> <sup>∀</sup>*h*∈[0*, <sup>T</sup> Ti(H ) ) Y HL <sup>t</sup>*+*Ti(H )*×*h)*; 13: **end if** 14: **if** ∀*τb*∈*Y (τa* ∩ *τb* = ∅*)* and |*(Y )*| *< M* **then** 15: **if** *t* exceeds the deadline of *fi* **then** 16: **return** unschedulable; 17: **end if** 18: *sa* ← *t*; *ra* ← a random channel that is not in *(Y )*; 19: *R* ← *R* − {*τa*}+ the next transmission of *τa*; 20: **if** *χi* == *H* and *τa* ∈ *<sup>i</sup>* ∪ *<sup>i</sup>* **then** 21: ∀*h* ∈ [0*, <sup>T</sup> Ti(H )), Y <sup>H</sup> <sup>t</sup>*+*Ti(H )*×*<sup>h</sup>* <sup>←</sup> *<sup>Y</sup> <sup>H</sup> <sup>t</sup>*+*Ti(H )*×*<sup>h</sup>* + {*τa*}; 22: **else if** *χi* == *H* and *τa* ∈ <sup>∗</sup> *<sup>i</sup>* **then** 23: ∀*h* ∈ [0*, <sup>T</sup> Ti(L)), Y HL <sup>t</sup>*+*Ti(L)*×*<sup>h</sup>* <sup>←</sup> *<sup>Y</sup> HL <sup>t</sup>*+*Ti(L)*×*<sup>h</sup>* + {*τa*}; 24: **else** 25: ∀*h* ∈ [0*, <sup>T</sup> Ti(L)), Y <sup>L</sup> <sup>t</sup>*+*Ti(L)*×*<sup>h</sup>* <sup>←</sup> *<sup>Y</sup> <sup>L</sup> <sup>t</sup>*+*Ti(L)*×*<sup>h</sup>* + {*τa*}; 26: **end if** 27: **end if** 28: **end for** 29: **end for** 30: **return** ∀*sa* and ∀*ra* ;

same mode at this time slot. Otherwise, it works in mode *w<sup>L</sup> α,t* . However, when its mode *w<sup>L</sup> α,t* is <sup>S</sup>, it must determine whether the assigned channel is clear or not before it sends the flow. If the channel has been occupied by H-crit flows, the flow has to be discarded. The switch time between different modes is very short compared with a time slot. For example, the switch time of the transceiver CC2420 is just 200 µs while a time slot is 10 ms. Generally, at a time slot, most nodes only serve one flow or are idle, while only a few nodes serve two flows.

#### **Algorithm 4.2** Working mode

**Input:** the scheduling results ∀*sa* and ∀*ra* **Output:** all *w<sup>L</sup>* <sup>∗</sup>*,*<sup>∗</sup> and *<sup>w</sup><sup>H</sup>* ∗*,*∗ 1: all *w<sup>L</sup>* <sup>∗</sup>*,*<sup>∗</sup> and *<sup>w</sup><sup>H</sup>* <sup>∗</sup>*,*<sup>∗</sup> are initiated as idle mode; 2: **for** ∀*τa* ∈ **do** 3: *i* ← *F(τa)*; *< nα, nβ >* are the sender and receiver of *τa*; 4: **if** *χi* == *H* **then** 5: ∀*h* ∈ [0*, <sup>T</sup> Ti(H )), w<sup>H</sup> α,sa*+*Ti(H )*×*<sup>h</sup>* <sup>←</sup>*<sup>&</sup>lt;* <sup>S</sup>*, ra <sup>&</sup>gt;*; 6: ∀*h* ∈ [0*, <sup>T</sup> Ti(H )), w<sup>H</sup> β,sa*+*Ti(H )*×*<sup>h</sup>* <sup>←</sup>*<sup>&</sup>lt;* <sup>R</sup>*, ra <sup>&</sup>gt;*; 7: **else** 8: ∀*h* ∈ [0*, <sup>T</sup> Ti(L)), w<sup>L</sup> α,sa*+*Ti(L)*×*<sup>h</sup>* <sup>←</sup>*<sup>&</sup>lt;* <sup>S</sup>*, ra <sup>&</sup>gt;*; 9: ∀*h* ∈ [0*, <sup>T</sup> Ti(L)), w<sup>L</sup> β,sa*+*Ti(L)*×*<sup>h</sup>* <sup>←</sup>*<sup>&</sup>lt;* <sup>R</sup>*, ra <sup>&</sup>gt;*; 10: **end if** 11: **end for** 12: **return** all *w<sup>L</sup>* <sup>∗</sup>*,*<sup>∗</sup> and *<sup>w</sup><sup>H</sup>* ∗*,*∗;

#### **4.5 Scheduling Analysis**

In this section, we analyze the worst case end-to-end delay for each flow and use the delay to test the schedulability of the flow set. If the worst case delay of all flows does not exceed deadlines, the flow set is schedulable. For the sake of simplicity, we first explain how to compute the worst case delay in single-criticality networks (in Sect. 4.5.1) and then extend it to mixed-criticality networks (in Sect. 4.5.2).

#### *4.5.1 Analyzing Method for Single-Criticality Networks*

Besides transmitting time, the end-to-end delay is introduced by the interference from higher priority flows. Therefore, in Sect. 4.5.1.1, we present the analyzing method of the total interference. In Sect. 4.5.1.2 we distinguish the different types of interference and compute the worst case delay.

#### **4.5.1.1 Total Interference**

During the time interval between the release and completion of the flow *fk*, all the active transmissions that belong to the higher priority flows may have node interference or scheduling interference to the flow *fk* . Therefore, in the worst case, the total interference is equal to the number of those higher-priority transmissions. The method of computing the workload in a period has been proposed in multiprocessor systems [30]. The mapping between the multiprocessor system model and the network model has been explained in the work [31], in which a channel corresponds to a processor and a flow is scheduled as a task. Therefore, we propose our analyzing method based on the work [30], which is the start-of-the-art analysis for multiprocessor systems. To make this chapter self-contained, we first simply introduce the method of multiprocessor systems, and then present our method.

For the simplicity of expression, the multiprocessor system uses the same notations as our network model. For multiprocessor systems, the calculation of the worst case delay of the task *fk* is based on the *level-k busy period* (as shown in Definition 4.1).

**Definition 4.1 (Level-k Busy Period for Multiprocessor Systems)** The level-k busy period is the time interval [*t*0*, tk )*, in which *tk* is the finish time of the task *fk*, and *t*<sup>0</sup> satisfies the following conditions:


If there is no *t*<sup>0</sup> that satisfies all conditions, then *t*<sup>0</sup> = *tr*.

The level-k busy period is determined by the workload of all higher-priority tasks. The set *P (f* ¯ *k)* contains the tasks with higher priority than the task *fk* . If the task *fi* (*fi* ∈ *P (f* ¯ *k)*) has a job that is released earlier than the level-k busy period and its deadline is in the busy period, then the task *fi* has the carry-in workload in the level-k busy period. Otherwise, the task has no carry-in workload. The two types of workload are presented as follows, and the length of the level-k busy period is *x*.

1. In the level-k busy period, if the task *fi* has no carry-in workload, the upper bound of its workload is

$$W\_k^{NC}(f\_l, x) = \left\lfloor \frac{x}{T\_l} \right\rfloor \cdot c\_l + \min\{x \mod T\_l, c\_l\},$$

where *ci* is the execution time of the task *fi*.

2. If the task *fi* has the carry-in workload, the upper bound of its workload is

$$W\_k^{CI}(f\_l, \mathbf{x}) = \left\lfloor \frac{\max\{\mathbf{x} - c\_l, \mathbf{0}\}}{T\_l} \right\rfloor \cdot c\_l + c\_l + \alpha,$$

where *α* = min{max{max{*x* − *ci,* 0} − *(Ti* − *Di),* 0}*, ci* − 1} and *Di* is the worst case delay of the task *fi*.

Based on the upper bounds of workload, two types of interference of the task *fi* to the task *fk* are as follows:

$$I\_k^{NC}(f\_l, \mathbf{x}) = \min\{\max\{W\_k^{NC}(f\_l, \mathbf{x}), \mathbf{0}\}, \mathbf{x} - c\_k + 1\},$$

$$I\_k^{CI}(f\_l, \mathbf{x}) = \min\{\max\{W\_k^{CI}(f\_l, \mathbf{x}), \mathbf{0}\}, \mathbf{x} - c\_k + 1\}.$$

Therefore, the total interference suffered by the task *fk* is

$$(\Omega\_{\mathbb{K}}(\mathbf{x}, \bar{P}^{NC}(f\_{\mathbb{K}}), \bar{P}^{CI}(f\_{\mathbb{K}})) = \sum\_{\forall f\_{l} \in \bar{P}^{NC}(f\_{\mathbb{K}})} I\_{k}^{NC}(f\_{l}, \mathbf{x}) + \sum\_{\forall f\_{l} \in \bar{P}^{CI}(f\_{\mathbb{K}})} I\_{k}^{CI}(f\_{l}, \mathbf{x}),$$

where *P*¯*NC(fk )* and *P*¯*CI (fk )* denotes the set of tasks without carry-in workload and the set of tasks with carry-in workload, respectively. In a busy period, at most *<sup>M</sup>* <sup>−</sup><sup>1</sup> higher-priority tasks have carry-in workload. Therefore, the set *<sup>P</sup>*¯*CI* contains *<sup>M</sup>* <sup>−</sup> <sup>1</sup> tasks that have maximal values of *<sup>I</sup>CI <sup>k</sup> (fi,x)* <sup>−</sup> *<sup>I</sup> NC <sup>k</sup> (fi,x)*. Other tasks are in the set *P*¯*NC*.

In the following, we propose our analyzing method. Industrial wireless networks apply strict periodic schedules based on superframes, which can reduce system complexity and run time overhead. While in multiprocessor systems and previous works about wireless networks, schedules are variable, i.e., the assigned time slots to a task (or a flow) are non-periodic, so our workload bounds are not the same as previous ones. Our workload bounds are computed with Theorem 4.1. Definition 4.2 defines the level-k busy period in the network.

**Definition 4.2 (Level-k Busy Period for Networks)** The level-k busy period is the time interval [*t*0*, tk)*, in which *tk* is the finish time of the flow *fk* and *t*<sup>0</sup> satisfies the following conditions:


If there is no *t*<sup>0</sup> that satisfies all conditions, then *t*<sup>0</sup> = *tr*.

**Theorem 4.1** *The workload bounds can be computed with*

$$W\_k^{NC}(f\_l, \mathbf{x}) = W\_k^{CI}(f\_l, \mathbf{x}) = \left\lfloor \frac{\mathbf{x}}{T\_l} \right\rfloor \cdot c\_l + \min\{\mathbf{x} \mod T\_l, c\_l\},\tag{4.2}$$

*where ci is the number of hops in the path πi, i.e. ci* = |*πi*|*.*

*Proof of Theorem 4.1* The computation of the non-carry-in workload *WNC <sup>k</sup> (fi,x)* is shown in Fig. 4.2a. There are *<sup>x</sup> Ti* complete periods and a scheduling window *(x* mod *Ti)*. In the scheduling window, at most *ci* workloads exist. Therefore, the expression of the non-carry-in workload is shown as Eq. (4.2).

In the following, we compute *WCI <sup>k</sup>* as shown in Fig. 4.2b. The notations *A* and *B* denote the two incomplete periods, respectively. We know that *A<Ti*, *B<Ti* and *A* + *B* = *(x* mod *Ti)* or *(x* mod *Ti* + *Ti)*. We discuss the two cases as follows.

**Case 1:** *A* + *B* = *x* mod *Ti* We draw out the windows *A* and *B* in Fig. 4.3a. We consider four different value ranges of the windows *A* and *B* as shown in Table 4.1,

**Fig. 4.2** Illustration of Theorem 4.1. (**a**) *WNC <sup>k</sup> (fi, x)*. (**b**) *<sup>W</sup>CI <sup>k</sup> (fi, x)*

**Fig. 4.3** Computation of *WCI <sup>k</sup>* . (**a**) *A* + *B* = *x* mod *Ti*. (**b**) *A* + *B* = *x* mod *Ti* + *Ti*

in which if *A* ≥ *Ti* − *Di* and *B* ≥ *Di*, it is Case 2. If *A<Ti* − *Di*, then there is no workload in *A*. If *B* ≥ *Di*, then all execution time *ci* must be the available workload. In this case, the workload can also be expressed as min{*B,ci*}. Therefore, only if *A<Ti* − *Di*, the workload is min{*B,ci*}. If *A* ≥ *Ti* − *Di* and *B<Di*, the time interval *Ti* − *Di* does not contain any workload. Therefore, the available window *A* + *B* is equal to *(x* mod *Ti)* − *(Ti* − *Di)*.

In Case 1, we can get that the total workload is

$$
\left\lfloor \frac{x}{T\_l} \right\rfloor \cdot c\_l + C1. \tag{4.3}
$$

The notation *C*1 denotes the workload in the incomplete period as shown in Table 4.1. It is equal to min{*B,ci*} or min{*x* mod *Ti* − *(Ti* − *Di), ci*}.


**Case 2:** *A*+*B* = *x* mod *Ti*+*Ti***, which is shown in Fig. 4.3b** In this case, there are *x*−*Ti Ti* complete periods. In the windows *A* and *B*, at most *ci* +min{*x* mod *Ti, ci*} workloads exist. Therefore, the workload of Case 2 is

$$
\left\lfloor \frac{x - T\_l}{T\_l} \right\rfloor \cdot c\_l + c\_l + \min\{x \mod T\_l, c\_l\}
$$

$$
\Rightarrow \left\lfloor \frac{x}{T\_l} \right\rfloor \cdot c\_l + \min\{x \mod T\_l, c\_l\}.\tag{4.4}
$$

Comparing with Eqs. (4.3) and (4.4), the upper bound of workload is Eq. (4.4). Since *(x* mod *Ti)* is not less than *B* and *(x* mod *Ti)* − *(Ti* − *Di)*, equation (4.4) is the same as Eq. (4.2). The theorem holds.

Due to the two types of workload having the same computing formula, we do not distinguish them in the following and use *Wk(fi,x)* to denote them. Based on the workload bound, the interference of the flow *fi* to the flow *fk* is

$$I\_k(f\_l, \mathbf{x}) = \min\{\max\{W\_k(f\_l, \mathbf{x}), \mathbf{0}\}, \mathbf{x} - c\_k + 1\}.$$

Thus, the total interference suffered by the flow *fk* is

$$\mathfrak{Q}\_k^{total}(\mathfrak{x}, \bar{P}(f\_k)) = \sum\_{\forall f\_l \in \bar{P}(f\_k)} I\_k(f\_l, \mathfrak{x}).$$

#### **4.5.1.2 Worst Case Delay in Single-Criticality Networks**

*<sup>n</sup> <sup>k</sup> (x, P (f* ¯ *k))* and *<sup>s</sup> <sup>k</sup>(x, P (f* ¯ *<sup>k</sup> ))* denote node interference and scheduling interference suffered by the flow *fk* in the level-k busy period. If there exists a node interference at a time slot, the flow *fk* cannot be transmitted at this time slot, no matter how many channels are idle, i.e., the flow *fk* is delayed one time slot due to the node interference. However, only when *M* transmissions are scheduled at a time slot, does the flow *fk* suffer scheduling interference and is delayed for one time slot. In the worst case, all the node interference and scheduling interference will introduce a delay to the flow *fk* . Therefore, the worst case delay is

$$\left| \Omega\_k^n(\chi, \bar{P}(f\_k)) + \left\lfloor \frac{\Omega\_k^s(\chi, \bar{P}(f\_k))}{M} \right\rfloor + c\_k \right. \tag{4.5}$$

From Eq. (4.5), we know that node interference introduces more delay. Since the sum of node interference and scheduling interference is *total <sup>k</sup> (x, P (f* ¯ *<sup>k</sup> ))*, so when as much as possible node interference occurs, the end-to-end delay is the worst case.

The upper bound of node interference introduced by *h* consecutive hops of the flow *fi* to the flow *fk* is computed as

$$R\_{k,l}(h) = \max\_{\forall a \in \{1, c\_l - h\}} \{ |\{\tau\_{lj}|\forall \tau\_{lj}, \,\text{y} \in [a, a+h], \,\exists \tau\_{k\mathbb{Z}} \text{ such that } \tau\_{lj} \cap \tau\_{k\mathbb{Z}} \neq \emptyset \} |\}.$$

Thus, the workload introduced by transmissions that have node interference is

$$W\_k^n(f\_l, \mathbf{x}) = \left\lfloor \frac{\mathbf{x}}{T\_l} \right\rfloor \cdot R\_{k,l}(c\_l) + R\_{k,l}(\min\{\mathbf{x} \mod T\_l, c\_l\}).$$

Then,

$$I\_k^n(f\_l, \mathbf{x}) = \min\{\max\{W\_k^n(f\_l, \mathbf{x}), \mathbf{0}\}, \mathbf{x} - c\mathbf{x} + 1\},$$

and

$$\Omega\_k^n(\mathfrak{x}, \bar{P}(f\_k)) = \sum\_{\forall f\_l \in \bar{P}(f\_k)} I\_k^n(f\_l, \mathfrak{x}).$$

Then, we can get that the worst case delay of the flow *fk* in the single-criticality network is

$$D\_k = \mathfrak{Q}\_k^n(\mathbf{x}, \bar{P}(f\_k)) + \left\lfloor \frac{\mathfrak{Q}\_k^{total}(\mathbf{x}, \bar{P}(f\_k)) - \mathfrak{Q}\_k^n(\mathbf{x}, \bar{P}(f\_k))}{M} \right\rfloor + c\_k.$$

From the definition of the level-k busy period, we know that the length *x* is the upper bound of the delay *Dk* (shown in Theorem 4.2).

**Theorem 4.2** *For the flow fk and the level-k busy period, the following holds:*

$$x \ge D\_k.$$

*Proof of Theorem 4.2* We assume by contradiction that *x<Dk*. From the definition of the level-k busy period (Definition 4.2), we know that the finish times of the busy period and the flow *fk* are the same, and *t*<sup>0</sup> must be less than (the first condition) or equal to *tr* (when *t*<sup>0</sup> does not satisfy at least one condition). If *x<Dk* , then *tr < t*<sup>0</sup> as shown in Fig. 4.4. It is not consistent with the definition. The above assumption does not hold.

According to Theorem 4.2, the solution of Eq.(4.6) is the upper bound of endto-end delay *Dk* .

$$\chi = \mathfrak{Q}\_k^\eta(\mathbf{x}, \bar{\varPhi}(f\_k)) + \left\lfloor \frac{\mathfrak{Q}\_k^{total}(\mathbf{x}, \bar{\varPhi}(f\_k)) - \mathfrak{Q}\_k^\eta(\mathbf{x}, \bar{\varPhi}(f\_k))}{M} \right\rfloor + c\_k \tag{4.6}$$

Equation (4.6) can be solved by the iterative fixed point search [32]. The iterative calculation of *x* starts with *x* = *ck*; until the value of *x* does not change.

#### *4.5.2 Mixed-Criticality Scheduling Analysis*

In dual-criticality networks, there are three types of worst case delay.


We use *D(x, Q, c)* to denote *<sup>n</sup> <sup>k</sup> (x, Q)*+ - *total <sup>k</sup> (x,Q)*−*n <sup>k</sup> (x,Q) M* +*c*. The methods of computing these types of delays are similar. The only difference is that higherpriority flows they suffered are different, i.e., their interference sets *Q* are different. H-crit flows have multiple paths. These paths suffer different interference and cause different delays. Therefore, we use sub-flows *f* ∗ *<sup>k</sup>* , *f <sup>k</sup>* and *f <sup>k</sup>* to distinguish them.

If there are H-crit flows with H-crit parameters in networks, L-crit flows can be discarded. Therefore, when we compute the delay *D<sup>L</sup> <sup>k</sup>* , all flows have L-crit parameters. Thus, *D<sup>L</sup> <sup>k</sup>* <sup>=</sup> *D(x, QL <sup>k</sup> , c*<sup>∗</sup> *<sup>k</sup> )*, where *QL <sup>k</sup>* = {*f* <sup>∗</sup> *<sup>i</sup>* |∀*f* <sup>∗</sup> *<sup>i</sup> , Ti(L) < Tk(L)*} and *c*∗ *<sup>k</sup>* = |*π*<sup>∗</sup> *k* |.

Similarly, for H-crit flows with L-crit parameters, the interference set is *QHL k* = {*f <sup>i</sup> , f <sup>i</sup>* |∀*f <sup>i</sup> ,* ∀*f <sup>i</sup> , χi* = *H,Ti(H ) < Tk(L)*}∪{*f* <sup>∗</sup> *<sup>i</sup>* |∀*f* <sup>∗</sup> *<sup>i</sup> , Ti(L) < Tk(L)*}. Thus, *DHL <sup>k</sup>* <sup>=</sup> *D(x, QHL <sup>k</sup> , c*<sup>∗</sup> *<sup>k</sup> )*, where *c*<sup>∗</sup> *<sup>k</sup>* = |*π*<sup>∗</sup> *k* |.

An H-crit flow with its H-crit parameter suffers the interference from H-crit flows with H-crit parameters. The H-crit flow has two sub-flows *f <sup>k</sup>* and *f k* . For these sub-flows, their interference set is *QH <sup>k</sup>* = {*f <sup>i</sup> , f <sup>i</sup>* |∀*f <sup>i</sup> ,* ∀*f <sup>i</sup> , χi* = *H,Ti(H ) < Tk(H )*}∪{*f* <sup>∗</sup> *<sup>i</sup>* |∀*f* <sup>∗</sup> *<sup>i</sup> , χi* = *H,Ti(L) < Tk(H )*} and *c <sup>k</sup>* = |*π k*|, *c <sup>k</sup>* = |*π <sup>k</sup>* <sup>|</sup>. Thus, *<sup>D</sup><sup>H</sup> <sup>k</sup>* <sup>=</sup> *D(x, QH <sup>k</sup> , c <sup>k</sup> )* and *<sup>D</sup><sup>H</sup> <sup>k</sup>* <sup>=</sup> *D(x, QH <sup>k</sup> , c <sup>k</sup> )*, and then *D<sup>H</sup> <sup>k</sup>* <sup>=</sup> max{*D<sup>H</sup> <sup>k</sup> , D<sup>H</sup> <sup>k</sup>* }.

According to the above delays, the schedulability test is as follows. For the Lcrit flow *fk* , if *D<sup>L</sup> <sup>k</sup>* ≤ *Tk(L)*, it is schedulable; otherwise, unschedulable. For the H-crit flow *fk*, if *DHL <sup>k</sup>* <sup>≤</sup> *Tk(L)* and *<sup>D</sup><sup>H</sup> <sup>k</sup>* ≤ *Tk(H )*, it is schedulable; otherwise, unschedulable. If all flows in a flow set are schedulable, the set is schedulable.

#### **4.6 Performance Evaluations**

In this section, we conduct experiments to evaluate the performance of our proposed methods.

#### *4.6.1 Scheduling Algorithm*

We consider three comparison methods: (1) **SMT** uses the Z3 solver [27], which is a high-performance solver being developed at Microsoft Research and whose solution has been regarded as an excellent standard, to solve our SMT specification (Sect. 4.3); (2) **noStealRM** applies the RM priority and does not allow slots to be stolen; (3) **StealCM** allows slots to be stolen and applies the criticality monotonic priority. Our method is **StealRM**. The performance metric we used is the *Schedulable ratio*, which is defined as the percentage of flow sets for which a scheduling algorithm can find a schedulable solution.

We randomly generate a number of test cases to evaluate these methods. For each test case, the number of channels *M* and the number of nodes |*N*| are given. According to the suggestion in the work [33], these nodes are placed randomly in the square area *<sup>A</sup>*, and *<sup>A</sup>* <sup>=</sup> <sup>|</sup>*N*|*d*<sup>2</sup> √ 27 <sup>2</sup>*<sup>π</sup>* , where the transmitting range *d* is 40 meters. Except for the gateway, each node has a data flow from itself to the gateway or vice versa. There are two necessary schedulability conditions for flow sets: (1) the network utilization *U* is not larger than 1; (2) the utilization of each node is not larger than 1. If a flow set does not satisfy the two conditions, it cannot be scheduled. Thus, in order to make flow sets available, we specify the network utilization *U (U <* 1*)*, and use the method UUniFast [34] to assign the utilization *ui* for each flow, where *U* = ∀*fi*∈*F ui*. Then, if the flow set can satisfy condition (2), it is an available flow

set. Otherwise, discard it, and repeat the process until an available set is found. The period of each flow can be obtained according to *Ti* <sup>=</sup> *ci ui* . The high-crit probability of the flows is controlled by the parameter *ρ*. Routing paths are selected randomly.

In order to make test cases solvable by the Z3 solver, the parameters are set as *ρ* = 0*.*3, *M* = 2 and *U* = 0*.*8. For each configuration, 100 test cases are checked using the four algorithms. Figure 4.5 shows their schedulable ratios. Our algorithm StealRM is close to the result of Z3. In these simple test cases, the method StealCM has similar results with our algorithm StealRM. Figure 4.6 shows the average execution time of solvable test cases in Fig. 4.5. When the number of nodes is 25, the execution time of the method SMT is about 16.5 minutes. We also use the method SMT to solve the network with 30 nodes, but cannot get the result within 3 hours. Except for the method SMT, the execution time of other methods is not more than 10 milliseconds. Therefore, from the perspective of execution time, heuristic algorithms are significantly more efficient than the method SMT.

Since the execution time of the method SMT is too long, the following experiments do not contain it. Figure 4.7 shows the schedulable ratios of the three scheduling algorithms. For each point in the figure, 500 test cases are randomly generated. From the figure, we can know that our algorithm StealRM has the highest schedulable ratio no matter with which parameters, while the algorithm noStealRM has the worst result. Therefore, the stealing mechanism can significantly improve the algorithm's performance. Our algorithm StealRM has better performance than the algorithm StealCM, especially when the node numbers are higher. This demonstrates that: (1) the priority should correspond to the urgency, but not the importance, while the stealing mechanism reflects the importance; (2) the urgency and the importance have to be distinguished, except in very small networks. Comparing these subfigures, we observe that schedulable ratios decrease with the increases of *ρ*, |*N*|, *U* and *M*. The reasons are as follows. An H-crit flow can be regarded as two L-crit flows. Thus, a larger value of the parameter *ρ* leads to more flows, which are hard to schedule. A test case contains |*N*| − 1 flows. Likewise, the larger |*N*| makes scheduling hard. The network utilization *U* corresponds to the network workload. Heavy workloads lead to scheduling failures. Note that compared with Fig. 4.7a, d has three additional channels, but its schedulable ratios decrease. Because the two subfigures generate test cases according to the respective numbers of channels. Their test cases are different. Although the number of channels increases, the utilization is not changed. When the utilization *U* is constant, with the increase of the number of channels *M*, the packets that need to be transmitted increase. The increased packets

**Fig. 4.7** Schedulability comparison among StealRM, StealCM and noStealRM. (**a**) *M* = 6*, U* = 0*.*5*, ρ* = 0*.*3. (**b**) *M* = 6*, U* = 0*.*5*, ρ* = 0*.*4. (**c**) *M* = 6*, U* = 0*.*6*, ρ* = 0*.*3. (**d**) *M* = 9*, U* = 0*.*5*, ρ* = 0*.*3

will introduce more interference, which has a negative impact on the scheduling performance. Therefore, Fig. 4.7d has a lower schedulable ratio than Fig. 4.7a.

Figure 4.8 shows the average execution time of Fig. 4.7. As the results are similar, we only show two subfigures for Fig. 4.7a, d. Compared with our algorithm StealRM, the algorithms StealCM and noStealRM need more time to find feasible solutions. Therefore, their execution time slightly increases. From the figure, we know that our algorithm StealRM does not introduce extra time costs. For the three algorithms, the execution time increases with the increase of the number of nodes, since more data flows need to be scheduled.

#### *4.6.2 Analyzing Method*

The comparison method is **SingleAna**, in which flow sets are tested using the single-criticality analysis. Our mixed-criticality analysis method is **MixedAna**. The performance metrics are the *analyzable ratio* (the percentage of flow sets which

**Fig. 4.8** Average execution time. (**a**) *M* = 6*, U* = 0*.*5*, ρ* = 0*.*3. (**b**) *M* = 9*, U* = 0*.*5*, ρ* = 0*.*3

**Fig. 4.9** Schedulability comparison among analyzing algorithms. (**a**) |*N*| = 20*, M* = 6*, ρ* = 0*.*1. (**b**) |*N*| = 20*, M* = 6*, ρ* = 0*.*3. (**c**) |*N*| = 20*, M* = 9*, ρ* = 0*.*1. (**d**) |*N*| = 60*, M* = 6*, ρ* = 0*.*1

are tested as schedulable by an analyzing method) and the *pessimism ratio* (the proportion of analyzed delay to the delay observed in StealRM). Figure 4.9 shows the comparison of analyzable ratios. For each point, 500 test cases are analyzed. Our method MixedAna outperforms SingleAna. The analyzable ratios decrease with

**Fig. 4.10** Delay comparison with StealRM being used as the baseline. (**a**) |*N*| = 20*, M* = 6*, ρ* = 0*.*1. (**b**) |*N*| = 20*, M* = 6*, ρ* = 0*.*3. (**c**) |*N*| = 20*, M* = 9*, ρ* = 0*.*1. (**d**) |*N*| = 60*, M* = 6*, ρ* = 0*.*1

the increase of these parameters. The reasons are similar to those in Fig. 4.7. The increases of *U* and *M* lead to more packets, and the increases of |*N*| and *ρ* lead to more flows. These will cause more interference. Thus, the analysis introduces more pessimism, and the analyzable ratios decrease. Figure 4.10 shows the pessimism ratios of experiments in Fig. 4.9. The pessimism ratios of MixedAna are less than 2, while the pessimism ratios of SingleAna are all larger than 2. This is because the interference that does not exist between H-crit and L-crit flows is eliminated in MixedAna.

#### **4.7 Summary**

Mixed-criticality data flows coexist in advanced industrial applications. They share the network resource, but their requirements for the real time performance and reliability are different. In this chapter, we propose a scheduling algorithm to guarantee their different requirements, and then analyze the schedulability of this scheduling algorithm. Simulation results show that our scheduling algorithm and analysis have more performance than existing ones.

#### **References**


**Open Access** This chapter is licensed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made.

The images or other third party material in this chapter are included in the chapter's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the chapter's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.

# **Chapter 5 Mixed-Criticality Scheduling with Multiple Radio Interfaces**

**Abstract** In this chapter, we introduce the nodes with multiple radio interfaces (MRI) into mixed-criticality industrial wireless networks. When an error occurs or transmission demand changes, the MRI nodes can switch their transmission mode, changing to a high-criticality configuration to meet the system's new demand. Hence, we first propose a heterogeneous MRI system model. Based on this model, we propose a Slot Analyzing Algorithm (SAA) that guarantees system schedulability by reallocating slots for each node after replacing conflict nodes with MRI nodes. By considering both system schedulability and cost, SAA also reduces the number of MRI nodes. Then, we propose a Priority Inversion Algorithm (PIA) that improves the schedulability by adjusting slot allocations before replacing conflict nodes with MRI nodes. By reducing the use of MRI nodes, PIA achieves better performance than SAA when the system is in the high-criticality mode.

#### **5.1 Background**

Due to the high real-time and reliability requirements of industrial systems, traditional cyber-physical systems cannot be applied directly [1–4]. To guarantee the requirements of ICPSs, we introduce multiple radio interface (MRI) nodes into ICPSs. A traditional network node is usually equipped with only one antenna, while an MRI node with two antennas, can both receive and send packets simultaneously [5–7]. By replacing conflict nodes with MRI nodes, multiple flows can transmit without delays. If we were to replace all the conflict nodes with MRI nodes, that would eliminate transmission conflicts in the system; consequently, when the number of MRI nodes is sufficient, we can guarantee system schedulability. However, considering the energy consumption and cost of MRI nodes, it is advantageous to be able to guarantee the network schedulability using fewer MRI nodes [8–12]. Hence, there are two main problems in mixed-criticality industrial wireless networks, (1) reducing the number of MRI nodes required to guarantee the network schedulability and (2) analyzing the network schedulability under different criticality modes. To address these problems, we propose two algorithms, a Slot Analyzing Algorithm (SAA) and a Priority Inversion Algorithm (PIA), to improve the network schedulability. SAA first allocates slots without considering transmission conflicts and replaces conflict nodes with MRI nodes to guarantee future schedulability in low-criticality mode. In contrast, PIA first optimizes slot allocation to reduce the number of transmission conflicts; then, we replace conflict nodes with MRI nodes only when the system cannot be scheduled. The contents of this chapter are as follows:


#### **5.2 System Model**

We consider a heterogeneous network consisting of field devices (both MRI nodes and traditional sensor nodes), one centralized controller and one gateway. In this section, firstly, we propose a network model, and then we introduce MRI nodes into mixed-criticality networks. Finally, we apply a fixed priority (FP) scheduling scheme in industrial wireless networks.

#### *5.2.1 Network Model*

The system model is based on WIA-PA [13]. There are several features as follows: (1) Time Division Multiple Access (TDMA); (2) Route and Spectrum Diversity and (3) Handling Internal Interference. The number of channels is denoted as *m*, and there are *N* fixed nodes in our system.

Industrial systems have higher requirements of real-time performance and reliability. Here, we introduce MRI nodes into industrial systems. MRI nodes are promising for wireless transmissions because they can improve the average user spectral efficiency [14]. By mounting multiple antennas on a single sensor node, the node can receive and transmit simultaneously (or improve the packet acceptance ratio when all the antennas work on the same channel).

### **Fig. 5.1** An example 9

Hence, our model includes two types of sensor nodes: traditional nodes and MRI nodes. Each traditional node in our system is equipped with a half-duplex omni-directional radio transceiver whose status can alternate between transmitting and receiving. In contrast, an MRI node has two working modes: (1) when the antennas work on different channels, the node can both receive and transmit packets from several paths (the transmission capacity of an MRI node depends on the number of antennas it has); and (2) when the antennas work on the same channel, the node can reduce signal interference and improve the acceptance ratio because several antennas receive a packet from the same flow. Each packet in our system is transmitted through the network under source routing.

Figure 5.1 shows an example of an MRI node in the first mode (where antennas work on different channels) to address a transmission conflict in which *F*<sup>1</sup> and *F*<sup>2</sup> send packets to the same destination simultaneously. We introduce MRI to solve this issue. The flows can be scheduled by replacing *V* 3 with an MRI node. MRI nodes can also be used as a method to increase the packet acceptance ratio when two or several antennas receive packets on the same channel. For the second mode of an MRI node (where the antennas work on the same channel), when the links around *V* 3 have poor signal quality (such as from co-channel interference, intermodulation interference, spurious emissions or adjacent-channel interference), node *V* 3 can switch its antenna receiving frequencies to the same channel to improve the acceptance ratio. However, considering that the power consumption and cost of MRI nodes is considerably higher than the cost of a normal node, we cannot deploy MRI nodes throughout the entire system.

#### *5.2.2 Mixed-Criticality System*

Due to the introduction of MRI nodes, our mixed-criticality system model differs from other models [15–19]. The flow is a periodic end-to-end communication between a source and its destination. There are *n* flows in our system, denoted by *F* = {*F*1*, F*2*,...,Fn*}. *Fi* is characterized by *< ti, di,ξ,ci, pi >*, a number between 1 ≤ *i* ≤ *n*, where the period is *ti*, the deadline is *di*, the criticality level is *ξ* (we focus on a dual-criticality system {*LO, H I* }) in which *ξ* = 2, meaning the system has two critical levels. The superframe as the lowest common multiple of the flow periods is denoted as T. Initially, the system works at a low critical level, and the MRI nodes receive packets on different channels. The system switches to the high critical level to enhance system reliability, and the MRI nodes reconfigure their antennas to receive high critical flow packets on the same channels when the accident occurs. Here, *ci* is the number of hops from a source to a destination, and the routing path is *pi*. When the system critical level switches from low to high, the MRI node's work pattern changes from receiving on different channels to receiving on the same channels to improve the schedulability of high critical flows. In addition, the characteristics of high-criticality flows switch to high-criticality mode. In this chapter, the system reduces the sampling period of a high-criticality flow to ℵ*iti* to improve the sampling rate of high critical flow, where ℵ*<sup>i</sup>* is a value that satisfies *ci ti* ≤ ℵ*<sup>i</sup> <* 1. To simplify the calculation we assume that *di* = *ti*. Hence, <sup>ℵ</sup>*<sup>i</sup>* satisfies *ci di* ≤ ℵ*<sup>i</sup> <* 1. We model the duration of the mode switch as *γ* , which is used to calculate the delay of packets delivered during the mode change.

In the beginning, packets are transmitted in low critical mode. To provide more resources, each MRI node's antennas work on different channels. The system switches when the accident occurs. To enhance system reliability in high-criticality mode, each MRI node's antennas are reconfigured to work on the same channel.

#### *5.2.3 Fixed Priority Scheduling*

We provide a summary of fixed priority scheduling to analyze the schedulability of systems in this subsection. FP scheduling is a commonly adopted scheme in practice for cyber-physical systems and real-time CPU scheduling [20]. Each job priority is pre-allocated by the network controller, and transmissions are scheduled based on this priority.

We assume that the priority of each flow is the same as its number. That is, *F*<sup>1</sup> has the highest priority, and *Fn* has the lowest priority in the system. There are two types of delays in industrial wireless sensor systems: (1) Channel contention and (2) transmission conflicts, the definitions can be obtained in [21].

We define a system as schedulable when all the flows in a system can be scheduled (reach the destination before its deadline). Then the definition of network schedulability is whether or not all flows in a network are schedulable. It is worth noting that when the system is in high-criticality mode, we no longer focus on the schedulability of low-criticality flows. When we repeat Z experiments, and only z experiments the emergency flow can be scheduled, then, the schedulability ratio is *<sup>z</sup> Z* .

#### **5.3 Problem Statement**

Given the flow set *F*, a wireless network, and the FP scheduling policy, our objective is to use MRI nodes to improve the schedulability of mixed-criticality industrial networks. We first analyze the schedulability of mixed-criticality industrial wireless networks. Initially, the system is working in low-criticality mode. To improve system schedulability, we introduce MRI technology to provide more resources (the resources such as slots and channels are increased since MRI nodes can receive and send packets simultaneously). Hence, we replace nodes at several intersections with MRI nodes and propose a Priority Inversion Algorithm to guarantee that the system can be scheduled. However, when the accident occurs, we must guarantee highcriticality flows schedulability; consequently, the system switches to high-criticality mode, and the transmission mode of MRI nodes changes. We then analyze the schedulability of our method to evaluate the quality of PIA. The challenges in this situation are listed below.


#### **5.4 Scheduling Algorithms**

In this section, we first study the issue of how to improve system schedulability with a small number of MRI nodes. First, we identify the nodes that may be replaced with MRI nodes to define candidate nodes as follows:

**Definition 5.1 (Candidate Node)** We define a candidate node as a node at which transmission conflicts (intersection or overlap nodes) can occur. As Fig. 5.1 shows, the paths of *F*<sup>1</sup> and *F*<sup>2</sup> intersect at *V* 3; consequently, a transmission conflict may occur at this node. Thus, *V* 3 is a candidate node.

Flows may conflict when they have path overlaps. To facilitate candidate node identification, we assume that, at most, one part of a path overlaps between two flows. As Fig. 5.2 shows, two periodic flows transmit in a network that conflict at

the second and third slots in the first period. There are two methods for addressing transmission conflicts. The first method is to reallocate the slots for each node after replacing the conflict nodes with MRI nodes (as Fig. 5.2 show, the system can be scheduled when we replace node *V* 5 with an MRI node, where CH is the abbreviation of Channel); the other method is to adjust slot allocation, as shown in Fig. 5.3. By rationally allocating each flow's transmission slots, we can reduce the number of MRI nodes and the signal interference caused by the coexistence of multiple channels, which can also improve the schedulability when the wireless network is in high-criticality mode. However, this is unsuitable for a system that

#### 5.4 Scheduling Algorithms 87

cannot be scheduled (in this example, the system cannot be scheduled if the deadline of *Fi* is 4).

Therefore, for a system in which each link's transmission slot has been allocated, we propose the slot analyzing algorithm to improve system schedulability under a traditional FP policy. When the system cannot be scheduled by MRI nodes, SAA re-allocates system resources to guarantee system schedulability (increase the transmission speed of unscheduled data flows). By considering the characteristics of mixed-criticality systems and MRI nodes, we then propose the PIA algorithm, which adjusts slot allocations before replacing intersection nodes with MRI nodes (the second method to address transmission conflict). By optimizing slot allocation, PIA can guarantee system schedulability with fewer MRI nodes. To guarantee the schedulability of the network, PIA will also re-allocate slots when the system cannot be scheduled. It is important to note that initially both the SAA and PIA algorithms work in low-criticality mode. We will analyze the schedulability of these two algorithms later.

#### *5.4.1 Finding Candidate Nodes*

A network consists of numerous nodes. In this subsection, we study how to select candidate nodes to guarantee the system can be scheduled. Transmission conflicts occur at the path overlaps of flows. As Fig. 5.4 shows, there are two types of overlaps (without considering the flow's direction).

**Lemma 5.1** *When flow paths have an overlapping region, the overlap nodes are candidates for MRI nodes. We denote the candidate node set as , and the node set on each flow's path can be denoted as λi.*

*Proof* Transmission conflict can obviously only occur at an overlapping region. We can solve this issue by MRI nodes. We can account for the conflicts caused by the first type as shown in Fig. 5.1. For the transmission conflict caused by the second type, as Fig. 5.4 shown, there are two nodes (*V* 1 and *V* 2) on both *F*<sup>1</sup> and *F*<sup>2</sup> involved in the second type of overlap. When this type of transmission conflict occurs, we can improve the schedulability by replacing both *V* 1 and *V* 2 with MRI nodes. Hence, when flow paths have an overlapping region, the overlap nodes are candidates for MRI nodes.

Hence, we propose a Candidate Node Searching Algorithm (CNSA) to search for the set of candidate nodes as follows:

We search the candidate nodes by traversing the flow paths of the entire system. Nodes on more than one flow path are added to the candidate node set . The time complexity of CNSA is *O(F*2*)*.

#### *5.4.2 Slot Analyzing Algorithm*

After obtaining the candidate node set, we reduce the number of nodes in this set to reduce the system's cost. Because not all the candidate nodes can experience transmission conflicts, we propose the slot analyzing algorithm to analyze the schedulability of the network under a traditional FP policy in one superframe (a superframe is the lowest common multiple of *ti*, *i* ∈ *F*). SAA improves system schedulability by replacing some of the nodes in with MRI nodes.

Since SAA is used after the CNSA, we do not consider the slot allocations for each flow; we just replace conflict nodes with MRI nodes when a transmission conflict occurs.

When the system cannot be scheduled, we need to improve the schedulability using MRI nodes. Because MRI nodes can both receive and send packets in a single time slot, we first allocate slots for each node without considering transmission conflicts (the network controller allocates the channel for each transmission using the FP scheduling policy). Then, we replace conflict nodes with MRI nodes to guarantee system schedulability. Obviously, it is both unnecessary and not costeffective to replace all the nodes in the candidate node set with MRI nodes. Therefore, SAA reduces the number of MRI nodes in through slot analysis. The pseudo code of the SAA algorithm is as follows:


We reallocate the transmission time slots for each node by the schedulability of each flow (lines 1–8). If the flow cannot be scheduled, we find the intersection nodes and reallocate the slots for this flow without considering transmission conflicts. Otherwise, we retain the original allocation. Then, we analyze the transmission slot for each node in (lines 9–23). When a node in has more than one transmission at the same time slot, that means a transmission conflict occurs at this node, and we need to replace the node with an MRI node (lines 9–13). When the system also cannot be scheduled, SAA then re-allocates slots to accelerate the transmission speed of unscheduled flows until the flows can be scheduled (lines 14–21). Finally, SAA updates *λi* and returns —the set of nodes that need to be replaced (lines 22–23). The theorem is as follows:

**Theorem 5.1** *A network can be scheduled with SAA when the number of channels is no less than the number of flows (m* ≥ *n).*

*Proof* When *k* flows conflict at node *A*, we denote the flow with the highest priority as *F*1, and the flow with the lowest priority as *Fk* . *F*<sup>1</sup> transmits first and cannot be delayed at node *A*. The other flows must wait on *F*1,consequently, this generates delay. When the number of channels is no less than the number of flows, no delay is caused by transmission conflicts. Hence, flow *Fi, i* ∈ *k* will miss its deadline and cannot be scheduled when *ci* + *deli > di*, where *del* is the delay slots. Using SAA, we can eliminate the delays caused by transmission conflicts. *k* flows can transmit simultaneously when *m>n* because the number of hops in each flow's transmission *c* is no larger than its deadline *d*. Thus, we can guarantee all the flows can be scheduled and, therefore, the system can be scheduled using SAA when the number of channels is no less than the number of flows.

#### *5.4.3 Priority Inversion Algorithm*

In this subsection, we study how to reduce the number of MRI nodes by the second method, the PIA scheduling algorithm, which performs optimal allocation of resources before the system runs. Through optimal allocation, PIA can decrease the number of transmission conflicts at intersection nodes and further reduce the number of required MRI nodes. As Fig. 5.5 shows, *V* 5 does not need to be replaced by an MRI node when *di* = 6 in Fig. 5.2a.

Initially, PIA allocates slots based on the traditional FP policy. If the system cannot be scheduled, the network controller obtains each flow's arrival time at its destination, which can be denoted as *ri*. Then, we can obtain the following theorem,

**Theorem 5.2** *When Fi and Fj conflict at node set V* = *V*1*, V*<sup>2</sup> *...,Vh (i<j ), we denote the length of the overlap as Len(ij ), and its conflict delay is D(ij ). The schedulability of Fi is unaffected by the priority inversion of Fi and Fj when it satisfies:(1) ri* + *D(ij )* ≤ *di;(2) V is the last part of the overlapping nodes of Fi.*

*Proof* The priority of *Fi* is higher than that of *Fj* based on the assumption that *i<j* . When transmission conflict occurs at node set *V* = *V*1*, V*<sup>2</sup> *...,Vh*, *Fj* must be delayed by *Fi*. We can accelerate the transmission speed by transmitting *Fj* first when the schedulability of *Fi* does not be changed. We introduce the result proposed by Saifullah in [22], in which the upper bound *(i, j )* of the delay that *Fj* can experience from an instance of *Fi* is

$$\Delta(ij) = \sum\_{k=1}^{\delta(lj)} len\_k(ij) - \sum\_{k'=1}^{\delta'(lj)} (Len\_{k'}(ij) - \mathfrak{Z}),\tag{5.1}$$

where *δ(ij )* is the number of path overlaps, *Lenk(ij )* is length of the *k*th overlap on *Fi* and *Fj* , *δ (ij )* is the number of path overlaps larger than 3. Hence, the problem is transformed into one of calculating the delay *Fi* must bear while waiting for *Fj* to transmit. By simplifying Eq.(5.2), we can obtain the delay in *V* as follows:

$$D(ij) = \begin{cases} Len(ij), & Len(ij) < 4, \\ Len(ij) - 3, & Len(ij) \ge 4. \end{cases} \tag{5.2}$$

When *V* is the last part of the overlap nodes of *Fi*, no other factors can cause additional delay to *Fi*. Hence, the schedulability of *Fi* is unaffected by the priority inversion of *Fi* and *Fj* when it satisfies:(1) *ri* + *D(ij )* ≤ *di*; and (2) *V* is the last part of the overlap nodes of *Fi*.

Based on Theorem 5.2, PIA accelerates the unscheduled flow until it can be scheduled or no longer influences the other flow's schedulability. However, Theorem 5.2 is not suitable for all overlaps. When *Fi* involves several parts of overlaps, we can only guarantee the acceleration of the low priority flow on the last overlap. For the flow's intersections with *Fi* in the other parts of the overlaps, we define an Effective Overlap Region(EOR) as follows:

**Definition 5.2 (Effective Overlap Region)** When *Fi* and *Fj* conflict in node set *V* = *V*1*, V*<sup>2</sup> *...,Vh* (*i<j* ), the overall node set *V* is the effective overlap region. If *Fi* and *Fj* have an overlap but do not conflict, then *V* is not an effective overlap region.

Hence, Theorem 5.2 can be extended as follows:

**Theorem 5.3** *When Fi and Fj conflict at node set V* = *V*1*, V*<sup>2</sup> *...,Vh (i<j ), the schedulability of Fi is unaffected by the priority inversion of Fi and Fj when it satisfies:(1) ri* +*D(ij )* ≤ *di; (2) it does not change the character of non-EORs after V ; and (3) V is the last EOR of Fi.*

*Proof* Based on Theorem 5.2 we extend priority inversion to the last part of the EOR of *Fi*. When the operation satisfies (1) *ri* + *D(ij )* ≤ *di*; (2) it does not change the character of non-EORs after *V* ; and (3) *V* is the last part of the EOR of *Fi*. Then, the schedulability of *Fi* and its intersection flows are unaffected by the wait for *Fj*

to transmit. Hence, when *Fi* and *Fj* conflict at node set *V* = *V*1*, V*<sup>2</sup> *...,Vh* (*i<j* ), the schedulability of *Fi* is unaffected by the priority inversion of *Fi* and *Fj* when it satisfies:(1) *ri* + *D(ij )* ≤ *di*; (2) it does not change the character of non-EORs after *V* ; and (3) *V* is the last part of the EOR of *Fi*.

To guarantee the second constraint condition in Theorem 5.3, we denote the number of overlaps after the last EOR in *Fi* as *oi*. For any flow *k*, when *Fk* and *Fi* have a path overlap after the last EOR in *V* , we denote this overlap path as *oik*. Hence, the fact that the second condition in Theorem 5.3 can be translated into the priority inversion operation does not affect the schedulability of *Fi* and *Fk* . Obviously, *Fk* and *Fi* cannot conflict when the packets generated by the two flows arrive such that *oik* satisfies

$$\|r\_l^{o\_{lk}} - r\_k^{o\_{lk}}\| > \,\text{D}ij\,,\tag{5.3}$$

where *r oik <sup>i</sup>* is the time at which the packet generated by *Fi* reaches *oik* (it is easy to obtain *oik* from the network controller). When the arrival time difference of *Fi* and *Fk* is larger than *Dij* , *oik* is not an EOR. By updating *r oik <sup>i</sup> , i* ∈ *F*, we can determine whether to invert the priority of *Fi* and *Fj* .

Based on the above discussion, PIA can reduce the number of transmission conflicts before adding MRI nodes to the system. Furthermore, PIA can also improve the schedulability of networks under a high-criticality mode. When the system cannot be scheduled under PIA, the nodes at flow intersections will be replaced by MRI nodes to guarantee the schedulability of the network. The pseudo code of PIA is as follows,

#### **Algorithm 5.3** Priority inversion algorithm

**Input:** the characters for each flow *Fi*; the candidate node set = {*λi*}, *i* ∈ *F*. **Output:** reduce the number of transmission conflicts by optimal slot allocations; 1: reallocation slots for each node by FP. 2: the number of MRI nodes *τ* = 0. 3: **while** the system cannot be scheduled **do** 4: **for** each flow *i* **do** 5: obtain each flow's *oi*, *Len* and the corresponding *oik*, *i, k* ∈ *F*; 6: **end for** 7: **for** each unscheduled flow *j* **do** 8: **if** flow *i* satisfies Theorem 5.3 **then** 9: invert the priority between *Fi* and *Fj* ; 10: **else** 11: replace the overlap nods with MRI nodes; 12: *τ* + +; 13: **end if** 14: **end for** 15: **end while** 16: **return** *τ* ;

PIA first allocates slots under the FP policy (line 1) and initializes the number of MRI nodes (line 2). Then, it judges whether the system can be scheduled or not. If the system can be scheduled, it returns *τ* , otherwise, PIA accelerates the transmission speed of unscheduled flows by Theorem 5.3. When the flows do not satisfy the conditions, PIA replaces the overlap nodes with MRI nodes, similar to SAA, and increments *τ* by one (lines 3–16).

When the system performs the priority inversion operation at the last EOR, the conflict is removed. Hence, that part of the overlap is no longer an EOR. The system repeats this process until either the system can be scheduled or no flow satisfies Theorem 5.3.

#### *5.4.4 Algorithm Analysis in High-Criticality Mode*

In this subsection, we analyze the schedulability of SAA and PIA. Since both SAA and PIA can be scheduled by adding MRI nodes in low-criticality mode, we analyze only the schedulability in high-criticality mode.

**Theorem 5.4** *PIA has a higher schedulability than SAA when the system is in highcriticality mode.*

*Proof* When the system switches to high-criticality mode, low-criticality flows are abandoned and the high criticality flow period changes to <sup>ℵ</sup>*iti, ci ti* ≤ ℵ*<sup>i</sup> <* 1. Because *ti* = *di*, the flow must arrive at its destination before ℵ*idi*. We analyze the schedulability by a discussion of classification. The flows are classified into two categories: (1) those in which the flow does not overlap other high-criticality flows and (2) those in which the flow overlaps other high-criticality flows. For *Fi* in the first category, the schedulability of both SAA and PIA are identical. When a flow is not blocked by other flows it can be scheduled when

$$
\eta\_l \le \aleph\_l d\_l. \tag{5.4}
$$

For *Fj* in the second category, *Fj* is delayed by other flows in *D(j )* slots. Then, *Fj* can be scheduled when

$$r\_j + D(j) \le \aleph\_j d\_j. \tag{5.5}$$

We denote the number of MRI nodes in SAA and PIA as *τ SAA <sup>j</sup>* and *<sup>τ</sup> PIA <sup>j</sup>* , respectively. Because PIA reduces the number of transmission conflicts before replacing intersection nodes with MRI nodes, *τ SAA <sup>j</sup>* <sup>≥</sup> *<sup>τ</sup> PIA <sup>j</sup>* . By Theorem 5.2, we can obtain

$$D(j) = \sum\_{k=1}^{t\_f} D(ij),\tag{5.6}$$

when *Fi* and *Fj* conflict, *D(ij )* = *Len(ij ), Len(ij ) <* 4 *(Len(ij )* − 3*), Len(ij )* ≥ 4 , which is

determined only by the length of the overlap. Then, we can obtain the relationship between SAA and PIA as follows:

$$r\_j^{PIA} + D(j)^{PIA} \le r\_j^{SAA} + D(j)^{SAA}.\tag{5.7}$$

Hence, PIA has a higher schedulability than SAA when the system is in highcriticality mode.

#### **5.5 Performance Evaluations**

We evaluate the performance of our proposed methods by experiments. We compare our approaches with the traditional FP algorithm without MRI nodes. We compare both the acceptance rate and the number of MRI nodes for each criticality mode. We use the acceptance rate to represent the schedulability of a network. When all flows can be scheduled, the acceptance rate is 1; otherwise, it is 0. To control the workload of the entire system, the simulations use the UUniFast algorithm, which can make the flows neither pessimistic nor optimistic for the analysis [23]. All algorithms are implemented in C language. These programs run on a Windows machine with 3.2 GHz CPU and 8 GB memory. Some simulation parameters are summarized in Table 5.1.

#### *5.5.1 Low-Criticality Mode*

We first compare the performances of the algorithms in low-critical mode. As Fig. 5.6(a) shown, the system acceptance rate is decreased by the FP scheduling policy (n=15, N=50, m=16), which occurs because the idle resources decrease as the system utilization increases. The latency tolerance of a packet is reduced along



**Fig. 5.6** Relationship between the acceptance rate/the number of MRI nodes and system utilization. (**a**) Acceptance rate. (**b**) The number of nodes

with the idle resources. The network can be scheduled under both SAA and PIA in any situation by increasing the number of MRI nodes when *m* ≥ *n*. Figure 5.6b shows the relationship between the number of MRI nodes and utilization. Obviously, both SAA and PIA can reduce the number of MRI nodes under the premise that the system is schedulable. Because PIA optimizes slot allocation before the node replacement operation, PIA uses fewer MRI nodes than SAA. However, none of the curves have an obvious tendency because system utilization involves not only the flow period (*t*) but also the number of transmission hops (*c*). We need to regenerate the transmission path for each flow to satisfy the system utilization requirements. Hence, the number of candidate nodes goes up and down. Because an MRI node is selected from the candidate node set, the number of MRI nodes is always less than the number of candidate nodes.

We repeat this simulation for the situation in which all flows can be scheduled as shown in Fig. 5.7. The number of candidate nodes is fixed when we increase system utilization by only adjusting the flow period (because there is only one test in this simulation, and the flow transmission paths do not vary). Initially, no MRI nodes exist in the system because they can be scheduled without any MRI nodes. However, when we increase the system utilization, transmission conflict occurs. To guarantee the schedulability of the system, we need to add MRI nodes to the system. In addition, the number of MRI nodes required by PIA is always less than the number required by SAA. This occurs because by optimizing slot allocation,

PIA can reduce the number of transmission conflicts. Hence, the number of MRI nodes required by PIA is always less than the number required by SAA.

The relationship between the acceptance rate/number of MRI nodes and the number of flows is shown in Fig. 5.8 (U=0.3, N=50, m=16). The acceptance rate is reduced along with the number of flows under the FP scheduling policy. The acceptance rates of SAA and PIA are reduced when the number of flows becomes larger than the number of channels. This result occurs because when *m<n*, delays are caused by channel contention. PIA achieves a better performance than SAA when *n >* 16 because it uses fewer MRI nodes. In addition, both the number of candidate nodes and the number of MRI nodes increase as the number of flows increases. This result occurs because the number of intersections increases when

the number of flows increases, causing more transmission conflicts in the system. Thus, the system requires more MRI nodes to guarantee its schedulability, and the number of MRI nodes always satisfies *τ F P > τ SAA > τ PIA*.

Figure 5.9 shows the relationship between the acceptance rate/number of MRI nodes and the number of nodes (U=0.3, n=15, m=16). All these results indicate that SAA and PIA can guarantee the schedulability of the system. The number of MRI nodes in both SAA and PIA is no larger than the number of candidate nodes regardless of the conditions. In addition, when the number of nodes increases to 90, the number of MRI nodes in PIA and SAA is identical because PIA transmutes into SAA when it cannot resolve the conflict.

#### *5.5.2 High-Criticality Mode*

When the system switches to high-critical mode, the number of MRI nodes is no longer our main concern (the number of MRI nodes is the same as in low-critical mode). Instead, we are more concerned with the performances of SAA and PIA in high-critical mode.

Figure 5.10 shows the relationship between the system acceptance rate and system parameters such as the number of nodes and the number of flows. In these

**Fig. 5.10** Relationship between the acceptance rate and system parameters in high-critical mode. (**a**) Acceptance rate. (**b**) The number of nodes

conditions, we set ℵ = <sup>0</sup>*.*<sup>9</sup> *<sup>&</sup>gt;* max{ *ci ti , i* <sup>∈</sup> *<sup>F</sup>*}. If max{ *ci ti , i* ∈ *F*} ≥ 0*.*9, we will regeneration the system. Figure 5.10 illustrates (as Theorem 5.4 proves) that the acceptance rate in PIA is always better than in SAA.

Figure 5.11 shows the relationship between the system acceptance rate and system utilization. To study the relationship between these two elements, we increase system utilization by adjusting only the flow period. Subsequently, we obtain the same result as Fig. 5.10, which also verifies the correctness of Theorem 5.4.

#### **5.6 Summary**

In this chapter, we first introduce MRI nodes into mixed-criticality networks. Then, we analyze the transmission paths and obtain the candidate node set. Next, based on the characteristics of MRI nodes, we propose SAA and PIA to guarantee

**Fig. 5.11** Relationship between the number of MRI nodes and system utilization in high-critical mode

the network schedulability in low-criticality mode. By considering system cost, these two algorithms help to reduce the number of MRI nodes used. Finally, we analyze the schedulability of these two algorithms when the system switches to high-criticality mode. The simulation results show that our scheduling algorithms perform better than existing scheduling policies.

#### **References**


**Open Access** This chapter is licensed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made.

The images or other third party material in this chapter are included in the chapter's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the chapter's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.

# **Chapter 6 Mixed-Criticality Scheduling on 5G New Radio**

**Abstract** Compared to industrial wired networks, 5G can improve device mobility and reduce the cost of networking. However, the real-time performance and reliability of 5G NR (new radio) still need to be improved to satisfy industrial applications' requirements. In factories, the main factor that affects the performance of 5G NR is the unstable signal quality caused by high temperatures and metal. Although assigning dedicated resources to all transmissions and retransmissions is an effective method to improve the performance of 5G NR, the unstable signal quality causes the resources required for retransmissions to be uncertain. To address the problem, we introduce the mixed-criticality task model to 5G NR. When highcriticality packets cannot be transmitted, they are allowed to preempt the resources shared with low-criticality packets. The mixed-criticality scheduling problem of 5G NR is NP-hard. We formulate it as an OMT (optimization modulo theories) specification and propose a scheduling algorithm based on bin packing methods to make 5G NR satisfy industrial applications' requirements. Finally, we conduct extensive evaluations based on an industrial 5G testbed and random test cases. The evaluation results indicate that our algorithm makes communication reliability greater than 99.9% on unlicensed spectrum, and for most test cases, our algorithm is close to optimal solutions.

#### **6.1 Background**

Ultra reliable low latency communication (URLLC) is one of main application areas defined in 5G. It aims to provide low latency and ultra-high reliability for missioncriticality services, which widely exist in industrial systems. Since the performance of URLLC is comparable to some wired networks, industrial systems are adopting 5G in place of wired networks to improve the mobility of devices and reduce the cost of networking [1–3].

For URLLC, all transmissions and retransmissions of industrial data must be assigned the resources of 5G NR (new radio), in advance, by a scheduling algorithm that runs in the base station. The resources of 5G NR include time slots and frequency bandwidth. In factories, high temperatures, high humidity, and metal seriously affect signal qualities. Thus, more retransmissions are needed to guarantee the reliability of industrial communications. However, on the one hand, the signal quality is dynamic and unpredictable. Before data packets are actually transmitted, the scheduling algorithm cannot determine how many retransmissions and network resources are sufficient for the highly reliable communications. On the other hand, the scheduling algorithm cannot assign as many resources as possible to all packets because wireless network resources are limited. Therefore, in order to make 5G NR meet the real-time and reliability requirements of industrial systems, the scheduling problem of 5G NR needs to be studied.

5G NR supports two-dimensional (2D) time-frequency resources. Since the 2D resources are different from other systems, some researchers have begun to study the new scheduling problems for 5G. The work in [4] proves the NP hardness of the new problem and proposes an algorithm based on Lagrangian duality to guarantee the real-time performance of as many services as possible. The work in [5] aims at the same objective and proposes two heuristic algorithms to generate schedules quickly. The work in [6] applies machine learning to improve real-time performance and data rate. Similarly, the work in [7], based on machine learning, proposes an energyefficient real-time scheduling algorithm. To make the proposed algorithms usable in actual systems, some real factors have been considered. The work in [8] considers the on-off operation of power amplifiers in the scheduling problem and proposes a sliding window-based algorithm to optimize the real-time performance and the energy efficiency for service transmissions. The work in [9] focuses on the impact of interference and channel estimation error on data rate. The work in [10, 11] studies how to guarantee the delay requirement under the minimum bandwidth. Although the scheduling problem of 5G NR has been studied more and more widely, the mixed-criticality scheduling problem of 5G NR has not been considered.

In industrial systems, control commands are the most important and must be delivered to devices in time, while some less important data, such as system logs and routine monitoring, can be delayed. Hence, under the limitation of 5G NR, the best way to schedule packets is to assign more resources to important packets, and allow the other packets to use the rest of the resources and the idle resources that have been assigned to the finished important packets. In other words, when the resources of 5G NR are insufficient, unimportant packets have to be discarded first. This process is typical of mixed-criticality scheduling. Some novel algorithms have been proposed to address the mixed-criticality scheduling problems of networks [12–17]. However, these algorithms cannot be used in the 5G NR model.

In this chapter, we introduce mixed criticality to 5G NR and propose a mixedcriticality scheduling algorithm to improve the real-time performance and reliability of industrial 5G networks. Much research has focused on mixed-criticality scheduling algorithms. However, the two main characteristics of our problem are not considered in other research.


To solve the mixed-criticality scheduling problem of 5G NR, this chapter includes the following:


#### **6.2 Problem Statement**

The symbols used in this chapter are summarized in Table 6.1.

We consider the scheduling problem under one base station and many users. A data flow is from a user to the base station (or from the base station to a user). In the following, we ignore the direction of flows because flows in different directions have the same resource requirement. In the flow set *F*, all flows have the same period *<sup>P</sup>*. Each flow *fi* generates a packet at time *<sup>j</sup>* <sup>×</sup> *<sup>P</sup>* (*<sup>j</sup>* <sup>∈</sup> <sup>Z</sup>), and the packet must be delivered to its destination before its absolute deadline *(j* + 1*)* × *P*. Since the packets contained in different periods have the same resource requirements, we only consider how to schedule packets in the first period *P*. After the first period, the subsequent schedules are periodically repeated.


**Table 6.1** Symbols

Flow *fi* is characterized by a three-tuple *< χi, Ci, li >*, which denotes its highest criticality level, transmission time durations and frequency bandwidth, respectively. The highest criticality level of our network is set to *X*, and for each *fi*, 1 ≤ *χi* ≤ *X*. We use *<sup>F</sup><sup>e</sup>* to denote the set of the flows with *χi* <sup>=</sup> *<sup>e</sup>*. The packet generated by *fi* is *τi*. *Ci* = {*c*<sup>1</sup> *<sup>i</sup> , c*<sup>2</sup> *<sup>i</sup> ,...,cχi <sup>i</sup>* } is the set of transmission time durations of *τi*. The flow with larger *χi* can occupy more time slots. At criticality level 1, *τi* is transmitted

**Fig. 6.1** Flow model. (**a**) (*li*,*c*<sup>1</sup> *<sup>i</sup>* ) at criticality level 1. (**b**) *τi* at multiple criticality levels

**Fig. 6.2** Two packets overlap each other

once in one time slot, and at criticality level *j* , *τi* is transmitted *j* times in *j* time slots, i.e., *c j <sup>i</sup>* <sup>=</sup> *<sup>j</sup>* <sup>×</sup> *<sup>c</sup>*<sup>1</sup> *<sup>i</sup>* . 5G numerology defines three subcarrier spacings (180, 360 and 720 kHz) and three corresponding slot lengths (1000, 500 and 250µs). We define 15 kHz and 250µs as the unit bandwidth and the unit slot length, respectively. Then, *(li, c*<sup>1</sup> *<sup>i</sup> )* ∈ {*(*1*,* 4*), (*2*,* 2*), (*4*,* 1*)*} (as shown in Fig. 6.1a). We use *xi* and *yi* to denote the start time and start frequency of the transmission of *τi*, respectively. The illustration is shown in Fig. 6.1b. Initially, at the lowest criticality level, *τi* is transmitted once in time duration *c*<sup>1</sup> *<sup>i</sup>* . If *τi* is not sent successfully in the duration, then its critically level is set to 2. At criticality level 2, the transmission time duration is increased to *c*<sup>2</sup> *<sup>i</sup>* , and *τi* is transmitted again. Repeat this process until the transmission is successful. If the transmission still fails in the longest transmission time duration *c χi <sup>i</sup>* , *τi* has to be discarded.

For any two packets *τi* and *τj* , the resources assigned to them are not allowed to *overlap* each other (Definition 6.1). An example is shown in Fig. 6.2. At criticality level 2, the two packets share resources. Then, *τj* may be preempted by *τi*. At the same criticality level, the packets are equally important and cannot preempt each other. Therefore, in feasible solutions, packet overlapping is not allowed.

**Definition 6.1** *τj* and *τi* **overlap** each other (as shown in Fig. 6.2), if the following conditions are all met.


If *τi covers τj* (Definition 6.2), *τj* may not be sent. As shown in Fig. 6.3, when *τi* is being transmitted at criticality level 3, the resources assigned to *τj* are being occupied by *τi*. Then, *τj* has to be discarded.

**Definition 6.2** *τi* **covers** *τj* (as shown in Fig. 6.3), if the following conditions are all met.


Our objective is to send as many packets as possible. Once a packet is covered, it may be discarded. If there are sufficient resources, no packets can be covered. For example, *xj* is set to *xi* + *c χi <sup>i</sup>* (as shown in Fig. 6.4). Then, *τi* and *τj* do not cover or

overlap each other. No matter which criticality level *τi* is at, *τj* is not affected. Only when resources are insufficient, *τi* is allowed to cover *τj* .

We formulate our problem as an OMT specification [20]. OMT is an extension of satisfiability modulo theories (SMT), which has been widely used to determine whether a specification is satisfiable or not. In addition to OMT supporting all the operators of SMT, it can also find an optimal objective. Our problem is to send as many packets as possible under scheduling constraints. Therefore, OMT is the best choice for our problem. The solution found by OMT not only satisfies scheduling constraints but also maximizes the number of packets sent. In the following specification, ∧, ∨ and ¬ denote the logical operations of conjunction, disjunction and negation, respectively.

Each flow in *F* generates one packet. All the packets are included in the packet set . These packets are transmitted in resources including a bandwidth of *L* and a time duration of *P*. The problem is how to determine *(xi, yi)* for each packet such that as many packets as possible are transmitted, and high-criticality packets are not covered as much as possible. Therefore, the objective is to minimize the weighted sum of the number of covered packets, as follows:

$$\min \sum\_{\forall e \in \{l, X\}} (\omega^e \times \sum\_{\forall \mathbf{r}\_l \in \Gamma^e} q\_l), \tag{6.1}$$

where *qi* <sup>=</sup> <sup>1</sup> indicates that *τi* is covered by a higher-criticality packet, *<sup>ω</sup><sup>e</sup>* is the weight of the *<sup>e</sup>*-th criticality level, and *<sup>e</sup>* includes the packets with *χi* <sup>=</sup> *<sup>e</sup>*, i.e., *<sup>e</sup>* = {*τi*|∀*fi* <sup>∈</sup> *F,χi* <sup>=</sup> *<sup>e</sup>*}. In order to ensure that high-criticality packets are not covered as much as possible, we set that *<sup>ω</sup>*<sup>1</sup> <sup>=</sup> <sup>1</sup> and <sup>∀</sup>*<sup>e</sup>* ∈ [2*, X*]*, ω <sup>e</sup>* <sup>=</sup> <sup>∀</sup>*g*∈[1*,e*−1] *<sup>ω</sup><sup>g</sup>* × |*g*| + 1, i.e., *<sup>ω</sup><sup>e</sup>* is greater than the weighted sum of all lowercriticality packets. Hence, to minimize the objective, when there are not sufficient resources, low-criticality packets are covered first.

To check if *τi* and *τj* cover or overlap each other, we define the following function

$$\begin{split} Disjoint(i, c\_l, j, c\_j) = (\mathbf{x}\_l \ge \mathbf{x}\_j + c\_j) \lor (\mathbf{y}\_l \ge \mathbf{y}\_j + l\_j) \\ \lor (\mathbf{x}\_j \ge \mathbf{x}\_l + c\_l) \lor (\mathbf{y}\_j \ge \mathbf{y}\_l + l\_l) .\end{split} \tag{6.2}$$

The function only considers time-frequency resources, and criticality levels are reflected in *ci* and *cj* .

We use *ri,j* to bridge *qi* and *Disj oint ()*. <sup>∀</sup>*fi* <sup>∈</sup> *F,* <sup>∀</sup>*fj* ∈ {*Fχi*+1*,...,F <sup>X</sup>*},

$$\begin{aligned} \left( (r\_{l,j} == 1) \land \neg \neg Disjoint(i, c\_l^{\chi\_l}, j, c\_j^{\chi\_j}) \right) \\ \lor \left( (r\_{l,j} == 0) \land Disjoint(i, c\_l^{\chi\_l}, j, c\_j^{\chi\_j}) \right), \end{aligned} \tag{6.3}$$

$$1 \ge q\iota \ge r\iota, j \ge 0.\tag{6.4}$$

In Eq. (6.3), if *τj* and *τi* cover or overlap each other, *ri,j* is equal to 1. However, the following constraint 2) can avoid overlapping between two packets. Thus, only when *τj* covers *τi*, *ri,j* = 1. Then, in Eq. (6.4), if there exists *ri,j* = 1, then *qi* = 1. The minimizing problem has to respect the following constraints.

1. Range constraint: The ranges of variables used in the specification are as follows.

$$\begin{aligned} \forall f\_l \in F, 0 \le \mathbf{x}\_l < P - c\_l^{\chi\_l}, 0 \le \mathbf{y}\_l < L - l\_l, \\ q\_l \in \{0, 1\}, r\_{l,j} \in \{0, 1\}. \end{aligned} \tag{6.5}$$

2. Overlap constraint: Any two packets are not allowed to overlap each other. Note that in Eq. (6.6) the transmission time duration of *τj* is at the highest criticality level of *τi* because the overlap of two packets only occurs at the same level.

$$\forall f\_l \in F, \forall \mathfrak{r}\_j \in \{\Gamma^\varepsilon | \forall e \in [\chi\_l, X] \}, Disjoint(i, c\_l^{\chi\_l}, j, c\_j^{\chi\_l}) = true. \tag{6.6}$$

A packet set is called *schedulable* if it has a feasible placement that meets all the constraints. When the objective is restricted to 0, the above problem is how to place all the packets into the rectangular area with dimensions *L* × *P*. This is the same as the 2D bin packing problem, in which a set of rectangular items is packed into a 2D rectangular bin. The NP-hardness of the 2D bin packing problem has been proven [21]. Since our problem can be reduced to the 2D bin packing problem, it is at least NP-hard. Hence, there is no polynomial time algorithm for finding an optimal solution. Although the specification (Eq. (6.1)–(6.6)) can be solved by OMT solvers, e.g. Z3, for complicated systems, the execution time of solvers cannot be acceptable. Therefore, in the following section, we will propose a heuristic algorithm to schedule packets.

#### **6.3 Scheduling Algorithm**

Firstly, we introduce a basic scheduling algorithm that does not consider the time constraint *P* and does not support any packet being covered. Secondly, based on the basic scheduling algorithm, we analyze the sufficient condition and necessary condition for schedulability. Finally, we extend the basic algorithm based on the two conditions to support time constraints and packet covering.

#### *6.3.1 Basic Scheduling Algorithm*

The basic scheduling algorithm is a pseudolevel-packing algorithm (as shown in Algorithm 6.1). Fig. 6.5 shows an illustration. There are two types of packing

**Fig. 6.5** Illustration of Algorithm 6.1

levels: *super level* and *local level*. A super level consists of multiple local levels. A local level is similar to the level that is widely used in multi-level bin packing algorithms, and its length is determined by the first packet placed at this local level. Algorithm 6.1 processes packets from the highest criticality level to the lowest criticality level (line 2). The packets with the same criticality level are placed at the same super level (lines 3–21). After all the packets in one criticality level are finished, a new super level is created to hold the packets in the next criticality level (lines 18–20). At each criticality level, the algorithm, first, sorts the packets according to the decreasing order of their transmission time durations (line 3), and then places packets in the same order (line 5). The single quotation mark on the symbols indicates that the symbols are sorted. For example, a sorted packet is denoted by *τ <sup>i</sup>* , and its frequency bandwidth and transmission time duration are *l i* and *c<sup>e</sup> <sup>i</sup>* , respectively. *h* is the finish time of all placed packets, and array *a*[ ][ ] is used to indicate which resources are occupied. If *a*[*y*][*x*] = 1, the resource at time slot *x* and on frequency *y* is occupied; otherwise, the resource is available. At each local level, the algorithm searches resources first in the order of time slots and then in the order of frequency (lines 6–15). If an available resource is found, i.e., *a*[*y*][*x*] = 0, the upper left corner of *τ <sup>i</sup>* is placed at coordinates *(x, y)* (line 16). The algorithm does not need to check all the resources that will be occupied by the rectangle of *τ <sup>i</sup>* because according to the above searching order, the other resources must be available as long as *a*[*y*][*x*] is available (Theorem 6.1). Then, based on the resources requested by *τ <sup>i</sup>* , *a*[ ][ ] is updated (line 17). If there is not sufficient resource in the current local level, a new local level is created (lines 7 and 8). Repeat this process until all packets are placed. Finally, the locations of all the packets and the finish time are returned to the calling function. The time complexity of the algorithm is *O(*||*Lh)* because the algorithm traverses all the packets of (lines 2 and 5) and all the resources of *L* × *h* (line 6). Since the basic scheduling does not support any packet being covered, the objective value is not considered in Algorithm 6.1.

**Algorithm 6.1** Basic Scheduling Algorithm *BasicSch()*

#### **Input:**

**Output:** ∀*(xi, yi)* and *h* 1: *h* = 0; *a*[ ][ ] = {0}; 2: **for** each *e* = *X* to 1 **do** 3: sort the packets of *<sup>e</sup>* according to the decreasing order of their *c<sup>e</sup> <sup>i</sup>* , where the first packet *τ* <sup>1</sup> has the largest *<sup>c</sup><sup>e</sup>* 1 ; 4: *<sup>x</sup>* <sup>=</sup> *<sup>h</sup>*; *<sup>y</sup>* <sup>=</sup> 0; *<sup>g</sup>* <sup>=</sup> *<sup>c</sup><sup>e</sup>* 1 ; 5: **for** each *<sup>i</sup>* <sup>=</sup> 1 to <sup>|</sup>*<sup>e</sup>* <sup>|</sup> **do** 6: **while** (*a*[*y*][*x*] == 1) or (*y* + *l <sup>i</sup>* ≥ *L*) **do** 7: **if** (*y* + *l <sup>i</sup>* ≥ *L*) **then** 8: *<sup>h</sup>* <sup>=</sup> *<sup>x</sup>* <sup>=</sup> *<sup>h</sup>* <sup>+</sup> *<sup>g</sup>*; *<sup>y</sup>* <sup>=</sup> 0; *<sup>g</sup>* <sup>=</sup> *<sup>c</sup><sup>e</sup> i* ; 9: **else** 10: *x* = *x* + 1; 11: **if** (*x* ≥ *h* + *g*) **then** 12: *x* = *h*; *y* = *y* + 1; 13: **end if** 14: **end if** 15: **end while** 16: *x <sup>i</sup>* = *x*; *y <sup>i</sup>* = *y*; 17: ∀*j* ∈ [*y, y* + *l <sup>i</sup>),* <sup>∀</sup>*<sup>k</sup>* ∈ [*x, x* <sup>+</sup> *<sup>c</sup><sup>e</sup> <sup>i</sup> ), a*[*j* ][*k*] = 1; 18: **if** (*<sup>i</sup>* == |*e*|) **then** 19: *h* = *h* + *g*; 20: **end if** 21: **end for** 22: **end for** 23: **return** ∀*(x i, y <sup>i</sup>)* and *h*;

**Theorem 6.1** *In the process of placing τ <sup>i</sup> , if a*[*y*][*x*] = 0 *and y* + *l <sup>i</sup> < L, then* ∀*j* ∈ [0*, l <sup>i</sup>),* <sup>∀</sup>*<sup>k</sup>* ∈ [0*, cχi <sup>i</sup> ), a*[*y* + *j* ][*x* + *k*] = 0*.*

*Proof* Assuming that ∃ ˆ*y* ∈ *(y, y* + *l <sup>i</sup>),* ∃ ˆ*x* ∈ *(x, x* + *c χi <sup>i</sup> ), a*[ ˆ*y*][ ˆ*x*] = 1. Recall that 5G numerology defines only three subcarrier spacings, 15 kHz, 30 kHz, and 60 kHz. Thus, at a super level, there are three types of packets. We use *B*1, *B*<sup>2</sup> and *B*<sup>3</sup> to denote them, and their widths and lengths are *<sup>B</sup>*<sup>1</sup> <sup>=</sup> *(l*1*, c*1*)*, *<sup>B</sup>*<sup>2</sup> <sup>=</sup> *(l*2*, c*2*)*, and *<sup>B</sup>*<sup>3</sup> <sup>=</sup> *(l*3*, c*3*)*, respectively. Based on the definition of three subcarrier spacings, we know that 4 × *l* <sup>1</sup> <sup>=</sup> <sup>2</sup> <sup>×</sup> *<sup>l</sup>* <sup>2</sup> <sup>=</sup> *<sup>l</sup>* <sup>3</sup> and *<sup>c</sup>*<sup>1</sup> <sup>=</sup> <sup>2</sup> <sup>×</sup> *<sup>c</sup>*<sup>2</sup> <sup>=</sup> <sup>4</sup> <sup>×</sup> *<sup>c</sup>*3. Since *<sup>y</sup>* <sup>+</sup> *<sup>l</sup> <sup>i</sup> < L*, the frequency resource is sufficient. Hence, we do not need to discuss the frequency dimension. We use row *y*¯ to denote the last row above row *y* and occupied by some packets. In the following, we discuss the three cases of row *y*¯.


**Fig. 6.6** Illustration of Theorem 6.1. (**a**) Illustration of Case (2). (**b**) Illustration of Case (3)

However, according to the searching order, the upper-left corner of the right packet should be at the point marked with a cross. Then, *a*[ ˆ*y*][ ˆ*x*] is not occupied, i.e., *a*[ ˆ*y*][ ˆ*x*] = 0.

(3) **Row** *y*¯ **is occupied by different types of packets.** The different types of packets must be *B*<sup>2</sup> and *B*3. Since in Algorithm 6.1, the packets are sorted according to the decreasing order of their transmission time durations, the current packet *τ <sup>i</sup>* must be *<sup>B</sup>*3. The illustration is shown in Fig. 6.6b. We know that *<sup>c</sup>*<sup>2</sup> <sup>=</sup> <sup>2</sup>×*c*3. Thus, two whole *<sup>B</sup>*<sup>3</sup> can be placed below *<sup>B</sup>*2. There is no other packet with different transmission time durations in this problem. Therefore, the packet that is not aligned with *<sup>B</sup>*<sup>2</sup> does not exist, and *<sup>a</sup>*[ ˆ*y*][ ˆ*x*] is not occupied, i.e., *a*[ ˆ*y*][ ˆ*x*] = 0.

To sum up, *a*[ ˆ*y*][ ˆ*x*] is not consistent with its definition. The above assumption does not hold. Therefore, ∀ ˆ*y* ∈ *(y, y* + *l <sup>i</sup>),* ∀ ˆ*x* ∈ *(x, x* + *c χi <sup>i</sup> ), a*[ ˆ*y*][ ˆ*x*] = 0.

#### *6.3.2 Analysis*

We, first, analyze the networks with only one criticality level, and then extend to multiple criticality levels. To simplify the description, when only one criticality level is considered, we ignore the symbols about criticality levels. In the networks with only one criticality level, the lengths of local levels can be *<sup>c</sup>*1, *<sup>c</sup>*<sup>2</sup> or *<sup>c</sup>*3, and *<sup>L</sup>* <sup>≥</sup> *<sup>l</sup>* 3. Assuming that in the result of Algorithm 6.1, there are *n*1, *n*2, and *n*<sup>3</sup> local levels with lengths of *<sup>c</sup>*1, *<sup>c</sup>*2, and *<sup>c</sup>*3, respectively, and *<sup>n</sup>*1*, n*2*, n*<sup>3</sup> <sup>∈</sup> <sup>N</sup> ∩ {0}.

When only one criticality level is considered, Algorithm 6.1 has the following two properties.

*Property 6.1* If *<sup>n</sup>*1+*n*2+*n*<sup>3</sup> <sup>=</sup> 1, and *<sup>L</sup>* approaches infinity, the resource utilization can be infinitesimal.

For example, there is only one packet in the network. Then, the resource utilization is *li*×*ci L*×*ci* , which decreases as *L* increases.

*Property 6.2* If *<sup>n</sup>*<sup>1</sup> <sup>+</sup> *<sup>n</sup>*<sup>2</sup> <sup>+</sup> *<sup>n</sup>*<sup>3</sup> *<sup>&</sup>gt;* 1, the resource utilization must be greater than <sup>1</sup> 2 .

*Proof* To calculate the resource utilization, we need to analyze the amount of resources required by Algorithm 6.1 and the amount of resources actually occupied. The resources required by Algorithm 6.1 is *<sup>E</sup>* <sup>=</sup> *L(n*1*c*1+*n*2*c*2+*n*3*c*3*)*. The amount of resources actually occupied is analyzed in each of the following cases:

(1) For the local levels with a length of *c*1, since the width of *B*<sup>1</sup> is the unit width, in the first *<sup>n</sup>*<sup>1</sup> <sup>−</sup> <sup>1</sup> local levels all the resources must be occupied. At the *<sup>n</sup>*1-th local level, if *<sup>n</sup>*<sup>2</sup> <sup>=</sup> *<sup>n</sup>*<sup>3</sup> <sup>=</sup> 0, at least one *<sup>B</sup>*<sup>1</sup> is placed, i.e., only *<sup>l</sup>* <sup>1</sup> <sup>×</sup>*c*<sup>1</sup> resources are occupied; if *<sup>n</sup>*<sup>2</sup> = 0, at most *(l*<sup>2</sup> <sup>−</sup> <sup>1</sup>*)* <sup>×</sup> *<sup>c</sup>*<sup>1</sup> resources are idle because *<sup>l</sup>* <sup>2</sup> <sup>×</sup> *<sup>c</sup>*<sup>1</sup> resources are sufficient for the subsequent *<sup>B</sup>*2; similarly, if *<sup>n</sup>*<sup>2</sup> <sup>=</sup> <sup>0</sup> and *<sup>n</sup>*<sup>3</sup> = 0, then *(l*<sup>3</sup> <sup>−</sup> <sup>1</sup>*)* <sup>×</sup> *<sup>c</sup>*<sup>1</sup> resources are idle. Thus, in the worst case, the amount of resources actually occupied in the *n*<sup>1</sup> local levels is

$$R\_{\mathbb{I}} = \begin{cases} Lc^{\mathbb{I}}(n^{\mathbb{I}}-1) + l^{\mathbb{I}}c^{\mathbb{I}}, & \text{if } n^{2} = n^{3} = 0 \quad (R\_{\mathbb{I}\mathbb{I}}), \\ Lc^{\mathbb{I}}n^{\mathbb{I}} - (l^{\mathbb{I}}-1)c^{\mathbb{I}}, & \text{if } n^{2} = 0, n^{3} \neq 0 \quad (R\_{\mathbb{I}\mathbb{I}}), \\ Lc^{\mathbb{I}}n^{\mathbb{I}} - (l^{\mathbb{I}}-1)c^{\mathbb{I}}, & \text{others}. \end{cases}$$

(2) For the local levels with a length of *<sup>c</sup>*2, in the first *<sup>n</sup>*<sup>2</sup> <sup>−</sup> <sup>1</sup> local levels, at most *(L* mod *l* <sup>2</sup>*)c*2*(n*<sup>2</sup> <sup>−</sup> <sup>1</sup>*)* resources are idle. This is because after placing several *B*2, the last *(L* mod *l* <sup>2</sup>*)* rows are not enough for the next *B*2. At the *n*2-th local level, if *<sup>n</sup>*<sup>3</sup> <sup>=</sup> 0, at least *<sup>l</sup>* <sup>2</sup>*c*<sup>2</sup> resources are occupied; otherwise, min{*(L* <sup>−</sup> *l* <sup>2</sup>*), (l*3−1*)*}*c*<sup>2</sup> resources are idle because if *<sup>L</sup>* is very short, after placing *<sup>B</sup>*2, the remaining resources may be less than *(l*<sup>3</sup> <sup>−</sup> <sup>1</sup>*)c*2. Thus, the amount of resources actually occupied in the *n*<sup>2</sup> local levels is

$$R\_2 = \begin{cases} Lc^2(n^2 - 1) - (L \mod l^2) \times c^2(n^2 - 1) + l^2c^2, & \text{if } n^3 = 0 \quad (R\_{2.1})\\ Lc^2(n^2 - 1) - (L \mod l^2) \times c^2(n^2 - 1) + Lc^2\\ -\min\{(L - l^2), (l^3 - 1)\} \times c^2, & \text{others.} \quad (R\_{2.2}) \end{cases}$$

(3) For the local levels with a length of *c*3, *R*<sup>3</sup> is similar to *R*2, i.e.,

$$R\_3 = Lc^3(n^3 - 1) - (L \mod{l^3}) \times c^3(n^3 - 1) + l^3c^3.$$

Thus, the total amount of resources actually occupied is *R* = *R*<sup>1</sup> + *R*<sup>2</sup> + *R*3. Table 6.2 shows *R* and the lower bounds of utilization *<sup>R</sup> <sup>E</sup>* under different cases. The lowest bound in Table 6.2 is <sup>1</sup> <sup>2</sup> . Therefore, the resource utilization must be greater than <sup>1</sup> <sup>2</sup> .

Then, based on Properties 6.1 and 6.2, we analyze the sufficient condition for a packet set to be schedulable by Algorithm 6.1. Theorems 6.2 and 6.3 are about one


**Table 6.2** Lower bound of resource utilization

criticality level and multiple criticality levels, respectively. In addition, the necessary condition for a packet set to be schedulable is shown in Theorem 6.4.

**Theorem 6.2** *For a packet set with only one criticality level, Algorithm 6.1 can find a feasible placement under the time constraint P, if* max{max∀*τi*∈{*ci*}*,* 2 <sup>∀</sup>*τi*∈ *li*×*ci L* } ≤ *P.*

*Proof* First, we discuss the placements with at least two local levels, i.e., *<sup>n</sup>*<sup>1</sup> <sup>+</sup> *<sup>n</sup>*<sup>2</sup> <sup>+</sup>*n*<sup>3</sup> *<sup>&</sup>gt;* 1. In the proof of Property 6.2, *<sup>R</sup>* is the lower bound of resources actually occupied. Thus, the actual occupied resources <sup>∀</sup>*τi*∈ *li* <sup>×</sup>*ci* is greater than or equal to *R*, i.e., <sup>∀</sup>*τi*∈ *li* <sup>×</sup> *ci* <sup>≥</sup> *R >* <sup>1</sup> <sup>2</sup>*<sup>E</sup>* <sup>=</sup> <sup>1</sup> <sup>2</sup>*L(n*1*c*<sup>1</sup> <sup>+</sup> *<sup>n</sup>*2*c*<sup>2</sup> <sup>+</sup> *<sup>n</sup>*3*c*3*)*. Rewriting, we obtain

$$\frac{2\sum\_{\forall \mathbf{r}\_l \in \Gamma} l\_l \times c\_l}{L} \succ n^1 c^1 + n^2 c^2 + n^3 c^3 \dots$$

If 2 <sup>∀</sup>*τi*∈ *li*×*ci <sup>L</sup>* <sup>≤</sup> *<sup>P</sup>*, then the actual length *<sup>n</sup>*1*c*<sup>1</sup> <sup>+</sup> *<sup>n</sup>*2*c*<sup>2</sup> <sup>+</sup> *<sup>n</sup>*3*c*<sup>3</sup> must be less than *P*, i.e., the placement is feasible under the time constraint *P*.

Then, from Property 6.1, we know that when *<sup>n</sup>*<sup>1</sup> <sup>+</sup>*n*<sup>2</sup> <sup>+</sup>*n*<sup>3</sup> <sup>=</sup> 1, 2 <sup>∀</sup>*τi*∈ *li*×*ci <sup>L</sup>* can be infinitesimal. However, the length of a local level is equal to the longest length of all the packets, i.e., max∀*τi*∈{*ci*}. Therefore, combining the above two cases, the sufficient condition is max{max∀*τi*∈{*ci*}*,* 2 <sup>∀</sup>*τi*∈ *li*×*ci <sup>L</sup>* } ≤ *P*.

**Theorem 6.3 (Sufficient Condition)** *For a packet set with multiple criticality levels, Algorithm 6.1 can find a feasible placement under the time constraint P, if*

$$\sum\_{\forall \epsilon \in \{1, X\}} \left( \max \{ \max\_{\forall \tau\_l \in \Gamma^{\varepsilon}} \{ c\_l^{\epsilon} \}, \frac{2 \sum\_{\forall \tau\_l \in \Gamma^{\varepsilon}} l\_l \times c\_l^{\epsilon}}{L} \} \right) \le P. \tag{6.7}$$

*Proof* Since Algorithm 6.1 places super levels one by one, the total length is the sum of the lengths of all super levels. If the total length satisfies the time constraint *P*, the placement is feasible.

**Theorem 6.4 (Necessary Condition)** *For a packet set with multiple criticality levels, if Algorithm 6.1 find a feasible placement for a packet set under the time constraint P, then the packet set satisfies the following condition:*

$$\sum\_{\forall \mathbf{r}\_l \in \Gamma} l\_l \times c\_l^{\chi\_l} \le L \times P. \tag{6.8}$$

*Proof* Note that in Algorithm 6.1 high-criticality packets are not allowed to cover low-criticality packets. Thus, if a packet set is schedulable, its resource utilization cannot be greater than 100%, i.e., <sup>∀</sup>*τi*∈ *li*×*<sup>c</sup> χi i <sup>L</sup>*×*<sup>P</sup>* <sup>≤</sup> 100%.

#### *6.3.3 Improved Algorithm*

In this subsection, we design our scheduling algorithm based on Theorems 6.3 and 6.4. The objective of our problem is to cover as few packets as possible, and low-criticality packets are covered first. Hence, we sort the packets of according to the following rules: ∀*τi, τj* ∈ ,

• if *χi > χj* , then *τi* is before *τj* in the ordered set ;

$$\text{• if } \chi\_l = \chi\_j \text{ and } c\_l^{\chi\_l} \succ c\_j^{\chi\_j}, \text{ then } \stackrel{\cdot}{\tau}\_l \text{ is before } \tau\_j \text{ in the ordered set } \Gamma';$$

• if *χi* = *χj* , *c χi <sup>i</sup>* = *c χj <sup>j</sup>* and *i<j* , then *τi* is before *τj* in the ordered set .

To optimize the objective, an effective method should cover the packets of from back to front. First, no packet can be covered, and the current packet set is checked whether it is schedulable or not under the time constraint *P*. If the packet set is not schedulable, the last packet *τ*| <sup>|</sup> is covered. Then, if the new packet set is still unschedulable, the packets *τ*| |−<sup>1</sup> and *τ*| <sup>|</sup> are covered. Repeat this process until a schedulable packet set is found. However, this method may traverse all the packets. To improve the efficiency of our algorithm, we reduce the solution space based on Theorems 6.3 and 6.4, and adopt binary search instead of linear search. In Theorem 6.5, we proved that the solutions corresponding to the sorted packets are also ordered. Thus, the binary search can be used in our scheduling problem.

Our scheduling algorithm is shown in Algorithm 6.2. The variable *k* is used to denote that the packets after the *k*-th packet can be covered, and the function *Cover(k)* (Algorithm 6.3) is to determine which packets are selected to cover these packets. In *Cover(k)*, for each packet *τ <sup>i</sup>* (*i>k*), the metric *δj* indicates the area difference between *τ <sup>j</sup>* and *τ <sup>i</sup>* in the time-frequency coordinate (line 8). If *τ <sup>j</sup>* cannot fully cover *τ <sup>i</sup>* , it is not an available selection (line 4). This is because if a small packet covers a big one, then the overflowing part of the big packet will change

**Algorithm 6.2** Scheduling Algorithm with packet Covering (SAC)

```
Input: 
         , X, L, P
Output: ∀(xi, yi)
1: k = |
           |;
2: do
3: 
       k = Cover(k); k = k − 1;
4: while 
           k does not satisfy Eq. (6.8);
5: r ight = k + 1;
6: do
7: 
       k = Cover(k); k = k − 1;
8: while k ≥ 0 and 
                     k does not satisfy Eq. (6.7);
9: lef t = k + 1; middle = lef t+right
                                2 ;
10: while lef t = middle do
11: BasicSch(
                  middle ) returns ∀(xmiddle,i, ymiddle,i) and h;
12: if h ≤ P then
13: lef t = middle;
14: else
15: r ight = middle;
16: end if
17: middle = lef t+right
                      2 ;
18: end while
19: if lef t = 0 then
20: return FALSE;
21: end if
22: return ∀(xlef t,i, ylef t,i);
```
the shape of the small packet, and the schedulability will become worse. Then, to reduce the waste of resources, the packet with the minimal *δj* is selected to cover *τ <sup>i</sup>* (lines 14–15), and the covered packet *τ <sup>i</sup>* is marked in (line 16). If none of the packets have a valid *δj* , *τ <sup>i</sup>* cannot be covered even though it is allowed to be covered. Finally, *Cover(k)* returns to Algorithm 6.2, called as *k* .

Algorithm 6.2 traverses *k* from | | to 1 (lines 1, 3 and 7). The first *k* that makes *<sup>k</sup>* satisfy the necessary condition is the rightmost element of the binary search (lines 2–5), and then similarly, the first *k* that makes *<sup>k</sup>* satisfy the sufficient condition is the leftmost element (lines 6–9). Then, in the binary search, for each middle element, *BasicSch( middle)* is invoked to place the packet set and returns the finish time. If the finish time is not greater than time *P*, a better solution may be between *middle* and *r ight*; otherwise, a feasible solution is between *lef t* and *middle* (lines 12–17). The leftmost element is always a feasible solution unless no packet set satisfies the sufficient condition. Thus, only when the leftmost element is 0, and the middle element does not search for any feasible solution, cannot be scheduled (lines 19 and 20). Otherwise, the placement under the latest leftmost element is the final solution (line 22). In Algorithm 6.3, the number of iterations in lines 1, 2, 6 and 15 is *O(*| |*)*, *O(*| |*)*, *O(X)* and *O(X)*, respectively. Thus, the time complexity of Algorithm 6.3 is *O(*| | <sup>2</sup>*X)*. In Algorithm 6.2, the number of invoking *Cover( )* is *O(*| |*)* in the worst case. Hence, the time complexity of lines 1–9 is *O(*| | <sup>3</sup>*X)*. Then, in lines 10–18, the number of invoking *BasicSch( )*

**Algorithm 6.3** Covering Algorithm *Cover(k)*

```
Input: 
        , k
Output: 
         , and obj
1: for each i = |
                 | to k do
2: for each j = i − 1 to 1 do
3: if χ
           j ≤ χ
                i or l

                    j < l
                         i then
4: δj = +∞;
5: else
6: for each g = χ
                       i + 1 to χ
                                j do
7: if c
                g
                j ≥ c
                     χ
                      i
                     j + c
                          χ
                           i
                          i then
8: δj = (cg
                      j − c
                           χ
                            i
                           j ) × l

                                 j − c
                                     χ
                                      i
                                     i × l

                                          i;
9: break;
10: end if
11: end for
12: end if
13: end for
14: if ∃τ 
          r, δr = +∞ and -
                         τ 
                          m, δm < δr then
15: ∀g ∈ [1, χ
                 i], cg
                    r = c
                          χ
                          i r + c
                               g
                               i ;
16: τ 
         i is marked as covered in 
                                 ;
17: end if
18: end for
19: calculate obj based on Eq. (6.1);
20: return  and obj ;
```
is *O(*log | |*)*, and its time complexity is *O(*log | |·| |*Lh)*. Therefore, the time complexity of Algorithm 6.2 is *O(n*4*)*.

**Theorem 6.5** *If <sup>k</sup> can be placed before time P, so can <sup>k</sup>*−1*, and Obj ( <sup>k</sup>*−1*)* <sup>≥</sup> *Obj ( <sup>k</sup>); if <sup>k</sup> cannot be placed before time P, neither can <sup>k</sup>*+1*, and Obj ( <sup>k</sup>)* ≥ *Obj ( <sup>k</sup>*+1*), where Obj ( <sup>k</sup>) is the objective value of packet set <sup>k</sup> calculated based on Eq. (6.1).*

*Proof* First, we prove that for our problem if *<sup>k</sup>* has a feasible solution, then *k*−1 also has a feasible solution, and the objective value of *<sup>k</sup>*−<sup>1</sup> is not greater than that of *<sup>k</sup>*. The difference between *<sup>k</sup>* and *<sup>k</sup>*−<sup>1</sup> is that *<sup>τ</sup> <sup>k</sup>* may be covered in *<sup>k</sup>*−1, while it cannot be covered in *<sup>k</sup>* . There are two cases:

1. When *τ <sup>k</sup>* is covered in *<sup>k</sup>*−1, we discuss all types of *<sup>τ</sup> <sup>k</sup>* as follows: if *τ <sup>k</sup>* is *<sup>B</sup>*1, in the same local level, the places of the subsequent packets are moved from *(x, y)* to *(x, y* − *l* <sup>1</sup>*)*; if *τ <sup>k</sup>* is *<sup>B</sup>*2, in the same local level, the places of the subsequent packets are moved from *(x, y)* to *(x, y* − *l* <sup>2</sup>*)*, *(x* <sup>−</sup> *<sup>c</sup>*2*,y)* or *(x* <sup>+</sup> *<sup>c</sup>*2*, y* <sup>−</sup> *<sup>l</sup>* <sup>2</sup>*)*; if *τ <sup>k</sup>* is *<sup>B</sup>*3, in the same local level, the places of the subsequent packets are moved from *(x, y)* to *(x* <sup>−</sup> *<sup>c</sup>*3*,y)* or *(x* <sup>+</sup> *(*the length of the local level*)* <sup>−</sup> <sup>1</sup>*, y* <sup>−</sup> *<sup>l</sup>* <sup>3</sup>*)*. In these cases, the subsequent packets are moved up and left in the same local level. Therefore, the finish time of *<sup>k</sup>*−<sup>1</sup> is not later than that of *<sup>k</sup>*. In addition, based on Eq. (6.1), if *τ <sup>k</sup>* is covered, *Obj ( <sup>k</sup>*−1*)* <sup>=</sup> *Obj ( <sup>k</sup>)* <sup>+</sup> *<sup>ω</sup>χ k* .

2. When *τ <sup>k</sup>* is not covered in *<sup>k</sup>*−1, *<sup>k</sup>* = *<sup>k</sup>*−1, i.e., they have the same solution, and *Obj ( <sup>k</sup>*−1*)* <sup>=</sup> *Obj ( k)*.

Therefore, if *<sup>k</sup>* can be placed before time *P*, so can *<sup>k</sup>*−1, and *Obj ( <sup>k</sup>*−1*)* <sup>≥</sup> *Obj ( k)*.

Second, for *<sup>k</sup>* and *<sup>k</sup>*+1, *<sup>τ</sup> <sup>k</sup>*+<sup>1</sup> can be covered in *<sup>k</sup>*, but cannot be covered in *<sup>k</sup>*+1. Packet *<sup>τ</sup> <sup>k</sup>*+<sup>1</sup> introduces more delay into the solution of *<sup>k</sup>*+1. Hence, if the finish time of *<sup>k</sup>* is greater than *P*, *<sup>k</sup>*+<sup>1</sup> cannot finish before time *<sup>P</sup>*. For the objective value, if *τ <sup>k</sup>*+<sup>1</sup> is covered in *<sup>k</sup>*, *Obj ( <sup>k</sup>)* = *Obj ( <sup>k</sup>*+1*)*+*ωχ <sup>k</sup>*+<sup>1</sup> ; otherwise, *Obj ( <sup>k</sup>)* = *Obj ( <sup>k</sup>*+1*)*. Therefore, if *<sup>k</sup>* cannot be placed before time *P*, neither can *<sup>k</sup>*+1, and *Obj ( <sup>k</sup>)* ≥ *Obj ( <sup>k</sup>*+1*)*.

#### **6.4 Performance Evaluations**

In this section, we will evaluate our proposed algorithms based on a 5G testbed and extensive test cases. Five metrics are used in our evaluation: (1) **packet loss ratio (PLR)** is the ratio of the number of lost packets to the total number of sent packets; (2) **schedulable ratio** is the percentage of test cases for which an algorithm can find a feasible solution; (3) **objective value** is calculated based on Eq. (6.1); (4) **execution time** is the time required to find an optimized solution; and (5) **the number of calls to** *BasicSch( )* reflects the effectiveness of Theorems 6.3 and 6.4.

Our proposed algorithm SAC is compared with the following methods:



value is about the covered packets. In FFDH, this kind of packets includes those that cannot be placed before *P*. Therefore, when some packets cannot be placed before *P*, they are used to calculate the objective value based on Eq. (6.1).

4. **SACwoT3T4** is the same as SAC except that it does not adopt Theorems 6.3 and 6.4 to reduce the solution space.

All algorithms are written in C and run on a Windows workstation with a 3.7 GHz CPU and 64 GB memory. The parameters used in the evaluation are summarized in Table 6.3. In a test case, *N* packets are transmitted in a 3D space of dimensions *X* × *L* × *P*. For each packet, its criticality level is randomly selected in the range [1*, X*], and the transmission time duration at the lowest criticality level and bandwidth are randomly selected in {*(*1*,* 4*), (*2*,* 2*), (*4*,* 1*)*}.

#### *6.4.1 Evaluations Based on A Real Testbed*

In this subsection, we evaluate packet loss ratios of different algorithms. The other metrics are not affected by the signal quality, and are more suitable for being tested through extensive test cases, which are shown in the next subsection. Our 5G testbed is shown in Fig. 6.7. It operates in the 2.4 GHz unlicensed ISM (industrial scientific and medical) band. The licensed spectrum is managed by mobile network operators, and developers and users cannot modify any strategy. Therefore, we adopt the unlicensed spectrum. If the strategies on the licensed spectrum are allowed to be customized, our proposed algorithms can be used without modification. Two 5G devices [24] are configured as a base station and a user, respectively. Since the signal quality is dynamic and unknown, to guarantee fairness for all algorithms, we trace the states of 7 subcarriers and 60,000 time slots, and then conduct trace-driven simulations.

First, in small networks, we compare SAC and OMT (as shown in Fig. 6.8). The parameter setting is *< N, X, L, P >*=*<* 10*,* 4*,* 7*,* 20 *>*, and *CLx* denotes the PLR at criticality level *x*. Since high-criticality packets can be transmitted more times, CL4 is the lowest. Both OMT and SAC successfully assign resources to the packets at criticality level 4. The average of CL4 in OMT and SAC are 0*.*072% and 0*.*067%, respectively. The slight difference between them is caused by the dynamics of signal quality. The average of CL1 in OMT and SAC are 16*.*7% and 17*.*0%, respectively. In SAC, since some low-criticality packets share resources with highcriticality packets, the CL1 of SAC is lower than that of OMT.

**Fig. 6.7** 5G testbed

**Fig. 6.8** Packet loss ratios in simple networks. (**a**) OMT. (**b**) SAC

Second, since OMT cannot solve complex problems in an acceptable time, we compare only SAC and FFDH in large networks (as shown in Fig. 6.9). The parameter setting is *<* 80*,* 4*,* 7*,* 80 *>*. Since the control period of the robotic arms in our testbed is 20 ms, and our 5G device supports 4 time slots in 1 ms, the parameter

**Fig. 6.9** Packet loss ratios in complicated networks. (**a**) SAC. (**b**) FFDH

*P* is set to 80. FFDH reserves dedicated resources for packets. When high-criticality packets do not need to be retransmitted, the assigned resources are wasted, and lowcriticality packets cannot obtain sufficient resources. Hence, the average of CL1 is about 70*.*9%. In addition, FFDH does not consider criticality levels so that some high-criticality packets are discarded. Therefore, FFDH has higher PLRs even at the highest criticality level. The average of CL4 in FFDH is about 17*.*2%. SAC makes the best of resources to guarantee the requirements of packets. Hence, the average of CL4 in SAC is 0*.*071%, and for CL1, when the PLR of FFDH is 70*.*9%, SAC improves PLR to 42*.*7%. In SAC, the PLR of the highest criticality level is still about 0*.*07%, no matter which networks SAC is used in. Thus, SAC makes communication reliability greater than 99*.*9% under real-time constraints.

**Fig. 6.10** Comparison with OMT. (**a**) Schedulable ratio. (**b**) Objective value

#### *6.4.2 Evaluations Based on Random Test Cases*

In the following, we will randomly generate extensive test cases to comprehensively evaluate the performance of our proposed algorithms. To make Z3 solvable, the parameter settings are *<* [10*,* 18]*,* 4*,* 7*,* 20 *>*, and 12 processes run in parallel on our workstation. For each parameter setting, 200 test cases are randomly generated. The results are shown in Fig. 6.10. The objective value is the average of 200 test cases. As *N* increases, the schedulable ratios decrease, and the objective value increases because it is hard to find optimized solutions when more and more packets are transmitted on limited resources. The worst algorithm is FFDH. Since in FFDH, no packet can be covered, the limited resources are not sufficient to transmit all packets. OMT has the highest schedulable ratio and the lowest objective value. However, the execution time of OMT fluctuates greatly. For some simple test cases, Z3 cannot find solutions within 12 hours. Thus, we set the time limit of Z3 as 1 hour. The execution times are shown in Fig. 6.11. When *N <* 16, almost all test cases can be solved within the time limit; when *N* ≥ 16, about 80% of test cases can be solved. Among all these test cases, the shortest execution time of OMT is 127 ms. Such a long execution time makes the network unable to respond to burst packets. However, when SAC is used to solve the same test cases, the longest execution time is only 0.19 ms. Even for the complicated test cases used in the following evaluations, the execution time of SAC is less than 3.7 ms, and the amount of memory space required is less than 1.2 MB. Therefore, SAC can quickly respond to burst packets and improve the flexibility of industrial networks.

Then, we increase the complexity of test cases. The parameter settings in Fig. 6.12 are *<* [40*,* 100]*,* 4*,* 10*,* 80 *>*. For each parameter setting, 1000 test cases are randomly generated. When *N >* 70, SAC has a higher schedulable ratio than T4 because SAC allows packets to share resources. Although this causes some low-criticality packets to fail to be sent, compared to FFDH, SAC discards only

**Fig. 6.11** Execution times of Z3. (**a**) *N* = 14. (**b**) *N* = 16. (**c**) *N* = 18

**Fig. 6.12** Comparison under varying *N*. (**a**) Schedulable ratio. (**b**) Objective value

34% of packets, i.e., SAC makes a trade-off between schedulability and reliability. Therefore, in a network with limited resources, to schedule more high-criticality packets, SAC is the best choice.

In Fig. 6.13, we change *X* to illustrate its effect on schedulable ratios and objective values. The parameter settings are *<* {60*,* 70}*,*{3*,* 4*,* 5}*,* 10*,* 80 *>*. To show the results more clearly, the objective values of SAC under *N* = 70 and *X* = 4 are displayed in Fig. 6.14. Due to the limited resources, some packets have to be covered. Hence, the objective values of some test cases are greater than zero. In Fig. 6.13, as *X* increase, the schedulable ratio decreases, and the objective value increases. This is because more retransmissions lead to a more serious lack of resources. Furthermore, if a test case contains more packets than others, it will be more severely affected by *X*. For example, Fig. 6.13b and d (*N* = 70) has greater fluctuations than Fig. 6.13a and c (*N* = 60). Thus, if there are many packets in a

**Fig. 6.13** Comparison under varying *X*. (**a**) Schedulable ratio. (**b**) Schedulable ratio. (**c**) Objective (**d**) Objective

network, *X* should be carefully determined based on the signal quality and should be as small as possible.

The parameter settings in Figs. 6.15 and 6.16 are *<* 80*,* 4*,*[8*,* 16]*,* 80 *>* and *<* 80*,* 4*,* 10*,*[70*,* 95] *>*, respectively. As *L* and *P* increase, the schedulable ratio increases, and the objective value decreases. This is because the more resources, the easier it is to schedule packets. In Figs. 6.15 and 6.16, when their total resources are the same, their schedulable ratios and objective values are similar. For example, in Fig. 6.15, when *L* = 11, the amount of resources is 880, and the schedulable ratio and objective value are 95% and 56, respectively. In Fig. 6.16, if the amount of

**Fig. 6.14** The objective values of SAC under *N* = 70 and *X* = 4

**Fig. 6.15** Comparison under varying *L*. (**a**) Schedulable ratio. (**b**) Objective

resources is 880, then *P* is 88. When *P* = 88, the schedulable ratio and objective value are 94% and 58, respectively. Therefore, *L* and *P* have similar effects on schedulability and reliability, i.e., if the time constraint *P* of an industrial system cannot be relaxed, we can improve the system performance by increasing *L*.

In Fig. 6.17, we compare SAC and SACwoT3T4. SACwoT3T4 adopts binary search to find solutions in the whole solution space. Compared to SACwoT3T4, SAC reduces the solution space based on Theorems 6.3 and 6.4. Thus, SAC can significantly decrease the number of calls to function *BasicSch()*. When *N <* 70, SAC can directly find the optimal solution for almost all test cases. Therefore, Theorems 6.3 and 6.4 are effective.

**Fig. 6.16** Comparison under varying *P* . (**a**) Schedulable ratio. (**b**) Objective

**Fig. 6.17** Comparison between SAC and SACwoT3T4

#### **6.5 Summary**

This chapter focuses on the mixed-criticality scheduling problem of 5G NR. We present the mixed-criticality 5G NR model and formulate the problem as an OMT specification. Then, for the schedulability of the mixed-criticality scheduling problem, we analyze its sufficient condition and necessary condition. Based on the two conditions, we propose a scheduling algorithm. Finally, an industrial 5G testbed and extensive test cases are used to evaluate our proposed algorithm. The evaluation results indicate that our proposed algorithm can improve the real-time performance and reliability of 5G NR.

#### **References**


**Open Access** This chapter is licensed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made.

The images or other third party material in this chapter are included in the chapter's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the chapter's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.

# **Chapter 7 Conclusions and Future Directions**

**Abstract** In this chapter, we summarize the book and provide three potential future directions for mixed-criticality industrial wireless networks.

#### **7.1 Conclusions**

In this book, we have introduced mixed criticality into industrial wireless networks, and presented analysis methods and scheduling algorithms to improve the QoS of industrial wireless networks.

In Chap. 1, we presented the concept of mixed-criticality industrial wireless networks. Industrial wireless networks have to meet the stringent QoS requirements of industrial applications. However, due to the openness of the wireless environment, the available network resources are limited. Mixed criticality is an advanced theory that makes limited resources fully utilized and can help industrial wireless networks improve their QoS.

In Chap. 2, we presented an end-to-end delay analysis method for fixed priority scheduling in mixed-criticality WirelessHART networks, which can be used to determine whether all flows can be delivered to destinations within their deadlines. In evaluations, we compared our analysis results with simulations and a testbed. The results show that the pessimism of our analysis is acceptable and reliable.

In Chap. 3, we focused on the analysis method under the EDF policy. Firstly, we proposed a novel network model that can switch routing strategies based on the criticality of networks. When errors or accidents occur, the network switches to high-criticality mode and low-level critical tasks are abandoned. Secondly, we analyzed the demand bound of mixed-criticality industrial wireless networks under the EDF policy and formulated network demand bounds in each criticality mode. Thirdly, we tightened the demand bound by analyzing carry-over jobs and classifying the number of conflicts to improve analysis accuracy. Simulation results demonstrate that the presented methods can estimate the schedulability efficiently.

Mixed-criticality data flows coexist in advanced industrial applications. They share the network resource, but their requirements for the real-time performance and reliability are different. In Chap. 4, we proposed a scheduling algorithm to guarantee their different requirements, and then analyzed the schedulability for this scheduling algorithm. Simulation results show that our scheduling algorithm and analysis have more performance than existing ones.

In Chap. 5, we first introduced MRI nodes into mixed-criticality networks. Then, we analyzed the transmission paths and obtained the candidate node set. Next, based on the characteristics of MRI nodes, we proposed the algorithm SAA and the algorithm PIA to guarantee the network schedulability in low-criticality mode. By considering system cost, these two algorithms help to reduce the number of MRI nodes used. Finally, we analyzed the schedulability of these two algorithms when the system switches to high criticality mode. The simulation results show that our scheduling algorithms and analysis perform better than the existing scheduling policy.

In Chap. 6, we focused on the mixed-criticality scheduling problem of 5G NR. We presented the mixed-criticality 5G NR model and formulated the problem as an OMT specification. Then, for the schedulability of the mixed-criticality scheduling problem, we analyzed its sufficient condition and necessary condition. Based on the two conditions, we proposed a scheduling algorithm. Finally, an industrial 5G testbed and extensive test cases were used to evaluate our proposed algorithm. The evaluation results indicate that our proposed algorithm can improve the real-time performance and reliability of 5G NR.

#### **7.2 Future Directions**

There are many potential future directions for mixed-criticality industrial wireless networks. Here, we list three promising directions, as follows.


#### 7.2 Future Directions 131

• *Testbed supporting mixed criticality*. Currently, mixed-criticality studies are evaluated based on simulations or real testbeds. Although the simulation is more flexible, it is too ideal to fully demonstrate the situation in real-world scenarios. A testbed can provide more comprehensive evaluations. However, there are no mixed-criticality hardware platforms and software protocol stacks. An easy-touse testbed will facilitate research and development.

**Open Access** This chapter is licensed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made.

The images or other third party material in this chapter are included in the chapter's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the chapter's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.